Not sure how to do this with combobox

N

NewbieAtLarge

Hi,

I am creating an access db and want to create two combo
boxes that are related to each other.

For example.
The first combo box list all the department names, eg:
Marketing, Accounting, etc.

The second combo box will list the people that are in the
department.

So if I select Marketing in the first combo box, I want to
see all the users in Marketing in the second combo box.
If I select Accounting, I want to see all the users in
accounting in the second combo box.

Thanks for any help.

NewbieAtlarge
 
A

Arvin Meyer

The second combo rowsource should read something like (change the fieldnames
to suit your application):

Select * From tblPeople Where DeptID = Forms!YourFormName!cboDepartment;

Use the AfterUpdate event of the first combo to requery the second:

Me.cboPeople.Requery
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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