Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Select Dependant Listboxes

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
Hi There

I wonder if someone can point me in the right direction as Ive been looking since yesterday but cant find the right code to meet my needs.

I have got a spreadsheet with 5 listboxes. They are set up as multiselect listboxes so that if desired users can select more than one item from the list box , for example they can select function from the first list box and then in the second listbox they can select the department codes that they want to filter by. This works perfectly but ideally I would like to change it so that when they select the function from the first listbox only contains the cost codes that are relevant to the function chosen in the first listbox.

Can anyone point me in the right direction of how to do this?
 
Hi Elsie

Make the result of the first Listbox, a criteria value for a query from a list or table...

SELECT COST_CODE
FROM LIST
WHERE DEPT = ?

Of course, the field/table names are fictitious.

This is accomplished via MS Query: Data > Get external data > From other sources > From Microsoft Query... and drill down to your workbook.

The ? Indicated a “parameter” query. The paramater can come directly from your sheet in the cell containing the SelectedDepartment. I like to use Data Validation (DV) > List rather than a control object.

Your Query resultset can then be the source to another Listbox or DV DropDown, etc., etc., ets...

Faq68-5829

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top