Using a list box to filter another list box

correlate
correlate used Ask the Experts™
on
Dear Experts,

Using Access 2010 I have a list box "Firm List" & want to enable the user to filter another list box "People List" on the same form to show data filtered by what they selected in the "Firm List" list box.

So for example .... "Firm List" shows all companies, when they select, say firm "ABC" then the second list box "People List" should list all employees for "ABC" by name.

Can anybody help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
in the afterupdate event of listbox "Firm List", filter the rowsource of listbox "People List"
* note avoid using spaces in names of controls

private sub FirmList_afterupdate()
me.PeoleList.rowsource="select employees, company from table where company=" & chr(34) & me.FirmList & chr(34)

end sub

Author

Commented:
brilliant - thank you very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial