cascading combo box error message

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


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
 
D

Douglas J. Steele

Are you sure that the AfterUpdate code is actually firing? Try putting a
breakpoint inside the routine (you click on the "gutter" to the left of the
code) and see whether execution stops inside the routine. (Alternatively,
put a message box inside the routine, and see whether it appears).

Other than that, I don't see any reason why it shouldn't be refreshing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
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


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


:

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
 
G

Guest

Doug I am sorry but I've never attempted to debug vba code before so I'll
have to do some research. Thanks for all your help

Talib
--
tm


Douglas J. Steele said:
Are you sure that the AfterUpdate code is actually firing? Try putting a
breakpoint inside the routine (you click on the "gutter" to the left of the
code) and see whether execution stops inside the routine. (Alternatively,
put a message box inside the routine, and see whether it appears).

Other than that, I don't see any reason why it shouldn't be refreshing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
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


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!)


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


:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top