cascading combo box error message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
What's the data type of Quartile? What you've got assumes it's a text field.

If it's numeric, get rid of the single quotes.
 
Thanks it worked like a charm!!!
--
tm


Douglas J. Steele said:
What's the data type of Quartile? What you've got assumes it's a text field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
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
 
Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest of the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo box
Thanks as always for your help. I've been trying to follow your suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm coming up
a little short.
--
tm


Douglas J. Steele said:
What's the data type of Quartile? What you've got assumes it's a text field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
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
 
Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any specific
advice.

What do you mean by "it does not select distinct records"? Are you saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest of the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm coming
up
a little short.
--
tm


Douglas J. Steele said:
What's the data type of Quartile? What you've got assumes it's a text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
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
 
No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase Percent. All
of the permitted increase percent values are in the table and they are based
on Quartile and Rating. It is a salary increase form that I am trying to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile 1 and
the rating Competent and should only see the associated increase percent, but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent should
only be the values the match the quartile and the rating. I hope this makes
sense. Thanks for your time and your patience.
--
tm


Douglas J. Steele said:
Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any specific
advice.

What do you mean by "it does not select distinct records"? Are you saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest of the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm coming
up
a little short.
--
tm


Douglas J. Steele said:
What's the data type of Quartile? What you've got assumes it's a text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
You're not including the Quartile in the Where clause of your SQL statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase Percent. All
of the permitted increase percent values are in the table and they are
based
on Quartile and Rating. It is a salary increase form that I am trying to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile 1 and
the rating Competent and should only see the associated increase percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent should
only be the values the match the quartile and the rating. I hope this
makes
sense. Thanks for your time and your patience.
--
tm


Douglas J. Steele said:
Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest of
the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
I have quartile in the after update code for cbo quartile. Is there some
other place that it needs to be? It works for some instances. When I select
quartile 1 and Adequate rating I get the correct percentages, but if I select
quartile 3 and Competent I get values associated with other quartiles. Thanks
--
tm


Douglas J. Steele said:
You're not including the Quartile in the Where clause of your SQL statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase Percent. All
of the permitted increase percent values are in the table and they are
based
on Quartile and Rating. It is a salary increase form that I am trying to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile 1 and
the rating Competent and should only see the associated increase percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent should
only be the values the match the quartile and the rating. I hope this
makes
sense. Thanks for your time and your patience.
--
tm


Douglas J. Steele said:
Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest of
the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
Since table Increases6-18 includes both Quartile and Rating, in order to
limit cboIncreasePercent to the approriate data, your SQL statement needs to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


talibm said:
I have quartile in the after update code for cbo quartile. Is there some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if I
select
quartile 3 and Competent I get values associated with other quartiles.
Thanks
--
tm


Douglas J. Steele said:
You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase Percent.
All
of the permitted increase percent values are in the table and they are
based
on Quartile and Rating. It is a salary increase form that I am trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile 1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent
should
only be the values the match the quartile and the rating. I hope this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest
of
the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo
box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
Hi Doug, When I put the code in the after update event for cboRating it
didn't like the syntax. It was highlighted in red. Thanks as always for your
help.
--
tm


Douglas J. Steele said:
Since table Increases6-18 includes both Quartile and Rating, in order to
limit cboIncreasePercent to the approriate data, your SQL statement needs to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


talibm said:
I have quartile in the after update code for cbo quartile. Is there some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if I
select
quartile 3 and Competent I get values associated with other quartiles.
Thanks
--
tm


Douglas J. Steele said:
You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase Percent.
All
of the permitted increase percent values are in the table and they are
based
on Quartile and Rating. It is a salary increase form that I am trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile 1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent
should
only be the values the match the quartile and the rating. I hope this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago (I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo box for
cboIncreasePercent. It works for the first selection, but the rest
of
the
time it does not select distinct records. This is what I have in the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo
box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
Exactly what did you put?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Hi Doug, When I put the code in the after update event for cboRating it
didn't like the syntax. It was highlighted in red. Thanks as always for
your
help.
--
tm


Douglas J. Steele said:
Since table Increases6-18 includes both Quartile and Rating, in order to
limit cboIncreasePercent to the approriate data, your SQL statement needs
to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


talibm said:
I have quartile in the after update code for cbo quartile. Is there some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if I
select
quartile 3 and Competent I get values associated with other quartiles.
Thanks
--
tm


:

You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase
Percent.
All
of the permitted increase percent values are in the table and they
are
based
on Quartile and Rating. It is a salary increase form that I am
trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating
of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile
1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent
should
only be the values the match the quartile and the rating. I hope
this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago
(I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo box
for
cboIncreasePercent. It works for the first selection, but the
rest
of
the
time it does not select distinct records. This is what I have in
the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo
box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but
I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
I copied the code from your previous response.
--
tm


Douglas J. Steele said:
Exactly what did you put?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Hi Doug, When I put the code in the after update event for cboRating it
didn't like the syntax. It was highlighted in red. Thanks as always for
your
help.
--
tm


Douglas J. Steele said:
Since table Increases6-18 includes both Quartile and Rating, in order to
limit cboIncreasePercent to the approriate data, your SQL statement needs
to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have quartile in the after update code for cbo quartile. Is there some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if I
select
quartile 3 and Competent I get values associated with other quartiles.
Thanks
--
tm


:

You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase
Percent.
All
of the permitted increase percent values are in the table and they
are
based
on Quartile and Rating. It is a salary increase form that I am
trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a rating
of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects Quartile
1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the Quartile.

There are four Quartile (1-4) and five Ratings (Adequate, Competent,
Commendable, Distinguishable and Provisional). The increase percent
should
only be the values the match the quartile and the rating. I hope
this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago
(I've
replied to hundreds of posts since then), I can't really offer any
specific
advice.

What do you mean by "it does not select distinct records"? Are you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo box
for
cboIncreasePercent. It works for the first selection, but the
rest
of
the
time it does not select distinct records. This is what I have in
the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" & _
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent combo
box
Thanks as always for your help. I've been trying to follow your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but
I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
Aargh.

No ampersand is required on the first line:

Me!cboIncreasePercent.RowSource = _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

Sorry about that.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
I copied the code from your previous response.
--
tm


Douglas J. Steele said:
Exactly what did you put?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
Hi Doug, When I put the code in the after update event for cboRating
it
didn't like the syntax. It was highlighted in red. Thanks as always for
your
help.
--
tm


:

Since table Increases6-18 includes both Quartile and Rating, in order
to
limit cboIncreasePercent to the approriate data, your SQL statement
needs
to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have quartile in the after update code for cbo quartile. Is there
some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if
I
select
quartile 3 and Competent I get values associated with other
quartiles.
Thanks
--
tm


:

You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with
the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase
Percent.
All
of the permitted increase percent values are in the table and
they
are
based
on Quartile and Rating. It is a salary increase form that I am
trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a
rating
of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects
Quartile
1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the
Quartile.

There are four Quartile (1-4) and five Ratings (Adequate,
Competent,
Commendable, Distinguishable and Provisional). The increase
percent
should
only be the values the match the quartile and the rating. I hope
this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago
(I've
replied to hundreds of posts since then), I can't really offer
any
specific
advice.

What do you mean by "it does not select distinct records"? Are
you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo
box
for
cboIncreasePercent. It works for the first selection, but the
rest
of
the
time it does not select distinct records. This is what I have
in
the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" &
_
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent
combo
box
Thanks as always for your help. I've been trying to follow
your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but
I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes
it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
Doug thanks so much for sharing your expertise. This works perfectly. Now I
have to requery and be able to save the data. Thanks again you're the best
--
tm


Douglas J. Steele said:
Aargh.

No ampersand is required on the first line:

Me!cboIncreasePercent.RowSource = _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

Sorry about that.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


talibm said:
I copied the code from your previous response.
--
tm


Douglas J. Steele said:
Exactly what did you put?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi Doug, When I put the code in the after update event for cboRating
it
didn't like the syntax. It was highlighted in red. Thanks as always for
your
help.
--
tm


:

Since table Increases6-18 includes both Quartile and Rating, in order
to
limit cboIncreasePercent to the approriate data, your SQL statement
needs
to
refer to both values:

Me!cboIncreasePercent.RowSource = & _
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & Me!cboRating & "' " & _
"AND [Increates6-18].Quartile = " & Me!cboQuartile & _
" Order By [Increases6-18].Increase_Percent;"

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have quartile in the after update code for cbo quartile. Is there
some
other place that it needs to be? It works for some instances. When I
select
quartile 1 and Adequate rating I get the correct percentages, but if
I
select
quartile 3 and Competent I get values associated with other
quartiles.
Thanks
--
tm


:

You're not including the Quartile in the Where clause of your SQL
statement.
That means you get the potential increases for all quartiles with
the
selected rating.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


No it's not repeating values it's not restricting them.
My table Increases6-18 contains Quartile, Rating and Increase
Percent.
All
of the permitted increase percent values are in the table and
they
are
based
on Quartile and Rating. It is a salary increase form that I am
trying
to
create.

Say Quartile 1 has 5 allowable increase percent values with a
rating
of
Competent (1%, 1.5%, 2.0%, 2.5% and 3.0%). The user selects
Quartile
1
and
the rating Competent and should only see the associated increase
percent,
but
I'm seeing all the values for the Rating regardless of the
Quartile.

There are four Quartile (1-4) and five Ratings (Adequate,
Competent,
Commendable, Distinguishable and Provisional). The increase
percent
should
only be the values the match the quartile and the rating. I hope
this
makes
sense. Thanks for your time and your patience.
--
tm


:

Since I have no recollection of what I replied over a month ago
(I've
replied to hundreds of posts since then), I can't really offer
any
specific
advice.

What do you mean by "it does not select distinct records"? Are
you
saying
that the combo box is repeating values?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas, I have another problem. I have added another combo
box
for
cboIncreasePercent. It works for the first selection, but the
rest
of
the
time it does not select distinct records. This is what I have
in
the
cboRating After Update.
On Error Resume Next
cboIncreasePercent.RowSource =
"Select Distinct [Increases6-18].Increase_Percent " & _
"From [Increases6-18] " & _
"WHERE [Increases6-18].Rating = '" & cboRating.Value & " '" &
_
"Order By [Increases6-18].Increase_Percent;"
I am not getting distinct records in the cboIncreasePercent
combo
box
Thanks as always for your help. I've been trying to follow
your
suggestions
in the 6/14/16 reply to re: cascading (e-mail address removed), but
I'm
coming
up
a little short.
--
tm


:

What's the data type of Quartile? What you've got assumes
it's a
text
field.

If it's numeric, get rid of the single quotes.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
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
 
It would help to post all of the code in your different AfterUpdate events.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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


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


Douglas J. Steele said:
It would help to post all of the code in your different AfterUpdate events.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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


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


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


Douglas J. Steele said:
It would help to post all of the code in your different AfterUpdate
events.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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


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


Douglas J. Steele said:
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
 
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)


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