G
Guest
Hi Doug. No it isn't a continuous form, but I did read your column to see if
it coulkd help me understand what's happening. It's not quite what I am
looking at. With your help I've been able to create the merit increase form
with 3 unbound combo boxes. My problem is that I don't know how to requery
the combo boxes. I have tried various things but so far none have worked.
--
tm
it coulkd help me understand what's happening. It's not quite what I am
looking at. With your help I've been able to create the merit increase form
with 3 unbound combo boxes. My problem is that I don't know how to requery
the combo boxes. I have tried various things but so far none have worked.
--
tm
Douglas J. Steele said:This isn't a continuous form, with the combo boxes on each row, is it? If
so, see whether what's in my February, 2006 "Access Answers" column in
Pinnacle Publication's "Smart Access" is relevant. You can download the
column (and sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
talibm said:Doug I'm not sure how to accomplish was you suggested. I moved the requery
statement before resetting the values to null but it still doesn't
requery.
Each record has the same data as the first record. I can't seem to get my
brain around this. Thanks
--
tm
Douglas J. Steele said:I think (but am too lazy to test) that resetting the RowSource will not
only
requery the table, but also reset it so that there's no row selected. At
the
very least, you definitely want to reset the RowSource before you set the
control to Null.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
You're a Gem. Here is what I have
cboQuartile after update
Me!cboRating = Null
Me!cboRating.Requery
On Error Resume Next
cboRating.RowSource = "Select Distinct [Increases6-18].Rating " & _
From [Increases6-18] " & _
"WHERE [Increases6-18].Quartile = " & cboQuartile.Value & " " & _
"Order By [Increases6-18].Rating;"
cboRating afterupdate
Me!cboIncreasePercent = Null
Me!cboIncreasePercent.Requery
Me!cboIncreasePercent.RowSource = _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increases6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"
Form Load
If IsNull(cboQuartile) Then
cboQuartile = Me.cboQuartile.ItemData(0)
Call cboQuartile_AfterUpdate
End If
form current
cboRating.Requery
cboIncreasePercent.Requery
That's it! Thanks
--
tm
:
It would help to post all of the code in your different AfterUpdate
events.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Doug if your tuned in I can't get the combo boxes to requery. This
is
what
I
have in the form load If IsNull(cboQuartile) Then
cboQuartile = Me.cboQuartile.ItemData(0)
Call cboQuartile_AfterUpdate
End If
In the on current event; cboRating.Requery
cboIncreasePercent.Requery
And in the after update event for cboQuartile I have
Me!cboRating = Null
Me!cboRating.Requery
And similar code for the cboRating after undate event. I wasn't sure
if
the
requery code should come before or after the existing code for the
combo
boxes. I hope this makes sense. If not I will start a new post.
Thanks
again
--
tm
:
Hello Access Nation, I am getting a Data Type mismatch error
message
when
I
select the second combo box in my form. I am trying to create 3
combo
boxes,
cboQuartile, cboRating, and cboIncreasePercent. All the data is in
one
table
Increases6-18. In cboQuartile RowSource I have SELECT DISTINCT
[Increases6-18].Quartile FROM [Increases6-18]. In the after update
code
for
cboQuartile I have On Error Resume Next
cboRating.RowSource = "Select Distinct [Increases6-18].Rating "
&
_
"From [Increases6-18] " & _
"WHERE [Increases6-18].Quartile = '" & cboQuartile.Value & "' "
&
_
"Order By [Increases6-18].Rating;"
I select cboQuartile and when I select the cboRating I get the data
type
mismatch error. Your help is much needed and appreciated. Thanks