Using multiple critera in a listbox for a query

Gabbelgak

New Member
Joined
Dec 14, 2016
Messages
22
Is there a way to limit a result based off multiple columns populated in a listbox from a query?

A single result works easily but I want to be able to select a result from a listbox which will then populate another listbox with a query based off two fields in the first listbox.

Preferably without any VBA
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Dont know what you mean by 'a single result works'.
You could reference the listbox and its columns in the second query. If the listbox is single select, I think the syntax is Forms!frmMyForm.lstMyList.Column(n), which you can specify as criteria in the second query. If the listbox is capable of multi select, that is a different story - you will be stuck with vba AFAIK.

Not using any vba also means you cannot prevent running the query if nothing is selected in the first listbox.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,776
Messages
6,161,870
Members
451,727
Latest member
tyedye4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top