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
[email protected], 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