Filter Query From MultiSelect List

Leesha
BronzeLounger
Posts: 1488
Joined: 05 Feb 2010, 22:25

Filter Query From MultiSelect List

Post by Leesha »

Hi,
I am trying to filter a query using a multiselect list. I was able to create a multiselct list using the instructions here: https://support.microsoft.com/en-us/kb/827423" onclick="window.open(this.href);return false;. Now I would like to be able to filter a query based on the information that is in the textbox, but am not sure how to do that.
Thanks and Happy Holidays!
Leesha

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Filter Query From MultiSelect List

Post by Rudi »

Hi Leesha,

Happy holidays to you too... :thankyou:

Access is definitely not my strongpoint, but might this post at Access-Programmers provide some hints or assistance? If I understand the syntax correctly, CustomerID(in the example) must be replaced with the name of the field in which you want to apply the filter values.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

Leesha
BronzeLounger
Posts: 1488
Joined: 05 Feb 2010, 22:25

Re: Filter Query From MultiSelect List

Post by Leesha »

Thanks for the link Rudi. I updated the query with the information from my database and didn't get any errors which is aways a good thing, however I'm not sure where the change is being made?
Leesha

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Filter Query From MultiSelect List

Post by Rudi »

Sorry I cannot be of more help than just passing along webpage references. I am not up to speed with SQL and integrating it into VBA; assuming you are using VBA in a form with a listbox. I managed to find what looks like a great step by step tutorial to help guide you with this task. If it does not help anymore you'd probably have to wait for Hans or one of our other Access experts to assist.

See here for a good tutorial link.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

Leesha
BronzeLounger
Posts: 1488
Joined: 05 Feb 2010, 22:25

Re: Filter Query From MultiSelect List

Post by Leesha »

Thanks Rudi! I'll give it a shot!

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Filter Query From MultiSelect List

Post by Pat »

Merry Christmas to you.

If I understand you correctly, you could create a table that would hold the list boxes selected entries.
The procedure would:
1. Clear that table
2. select the required list box entries.
3. write them to the new table when you are satisfied you have marked them all as required.
4. link the new table to your main query based upon the list box field , whatever that is. That field needs to be in your query as a discreet field.

A zipped DB of just the selected objects and test data would be helpful.

User avatar
HansV
Administrator
Posts: 78589
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Filter Query From MultiSelect List

Post by HansV »

Hi leesha,

Do you really need a query to be filtered, or would it be sufficient to filter a form or report using a multi-select list box?
Best wishes,
Hans