change combo box options based on another selection

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

Guest

I have two combo boxes, one with county names, one with departments. There
are different departments for each county. Once a user selects a county name,
I'd like the department combo box to populate with the correct department
possibilities for the chosen county.

Can anyone point me in the right direction of how I can accomplish this?

Thanks!
Emma
 
Emma,
I just did this myself. You need to add a WHERE statement to the
recordsource of the Dept cbo box. Those two tables should be linked by
one field. Make the dept field equal to
Forms!YourFormName!LinkingFieldName.

Replace YourFormName and LinkingFieldName.

You will also need to add this to the AfterUpdate event of the County
Name cbo box:

me.cboDept.requery

Replace cboDept with the control name for the dept combo box. This
allows the user to change the county and the second box will correct
itself.

Hope this helps!
 
Back
Top