combo box values dependent on user's selection of another combo box

  • Thread starter Thread starter jenn
  • Start date Start date
J

jenn

i have a combo box that i need to fill.. the values of
this combo box and redependent of the value selected in
another combo box. This process should be in the
after_update of the first combo box, correct?.. how
exactly would i do this.. this is what i have (and i am
getting a type mismatch error on it, with
the ".recordsource" highlighted):

cmbState.RowSource = CurrentDb.OpenRecordset("SELECT
tblStateTaxDepts.StateAbrv FROM tblStateTaxDepts WHERE
tblStateTaxDepts.TaxType = '" & strTaxType & "';")

Any help would be greatly appreciated. thanks
 
Close (expression is all one line, so watch out for wrapping by newsreader):

cmbState.RowSource = "SELECT tblStateTaxDepts.StateAbrv FROM
tblStateTaxDepts WHERE tblStateTaxDepts.TaxType = '" & strTaxType & "';"
 
I have modified the code step that you'd posted. Replace your code step with
the one I posted.
 
thank you!.. except if the user goes to change the value
of the tax type again the state combo box list does not
get refreshed with the new values

thanks for your help!
 
I am assuming that you're running the code on the "tax type" combo box's
AfterUpdate event, no? So long as you run the code on that event, the code
will change the SQL query string for the "state" combo box.

Perhaps, if you post all the code that you're running for these two combo
boxes, we can help fix this minor issue.
 
Got it.. thanks so much!!
-----Original Message-----
thank you!.. except if the user goes to change the value
of the tax type again the state combo box list does not
get refreshed with the new values

thanks for your help!
selected i
.
 
Back
Top