change combo box options based on another selection

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
 
A

Angi

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!
 

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