Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

MS Access 2003 dropdown list question

Oct 25, 2007 10:57PM PDT

I'm making a form for project tracking. In it are a few dropdown lists that can be used to select Manager and then Employee. What I would like is if Manager A is selected the only those employees that report to him are displayed in the next list. I can't seem to figure this out and I really don't know what to call it so searching for help has been very difficult.

Any assistance you can supply will be most appreciated.

Discussion is locked

- Collapse -
Re: dropdown box
Oct 29, 2007 7:57PM PDT

Berfert,

That's easy. Have the query for the employee dropdown box reference the manager field in the form, and you're done. This, of course, implies that the employee table contains the ID-field (primary key) of the appropiate manager as a foreign key field.

Say the form name is frm_myform and the dropdownboxes are called cbo_manager and cbo_employee.
Then the query for the employee-dropdownbox is something like SELECT EMP_NO EMP_NAME FROM EMPLOYEE WHERE MANAGER_ID = FORMS!MYFORM!CBO_MANAGER.
And in the After Change event procedure of cbo_manager you've got to refresh cbo_employee:
ME![COB_EMPLOYEE].REQUERY

That's all.

If things like "foreign key" and "event procedure" are unknown to you, better ask your boss to hire an Access-programmer for half a day or a full day and give you a personalized training-on-the-job. It will well be worth the costs, because it will enable you to make much nicer forms for him and your colleagues.

Hope this helps.


Kees




And that's all.

- Collapse -
(NT) Bless You! Kees!!!
Oct 30, 2007 8:58PM PDT
- Collapse -
(NT) You're welcome.
Oct 30, 2007 10:37PM PDT