Refresh Combo Box in Form

G

Guest

I have two combo boxes in my form.
The first combo box contains the company names. The second combo box
contains department names under the company.
What I want to do is that if I choose a company, the 2nd combo box will show
all and only the departments under that company.
I used a query to set that up. It works all well except whenever I choose
another company name, the 2nd combo box will not change accordingly. I have
to go to the menu, click Tools - Refresh; or set up a command button to
refresh the data.
Is there an easy way to set up something in the form so that the department
combo box will get updated/refreshed whenever I reselect the company.
Thanks a lot.
 
K

kingston via AccessMonster.com

Use the first combobox's AfterUpdate event to requery the second combobox:

Me.ComboBox2.Requery
 

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