request several data in a parameter (1 Viewer)


New member
Local time
Today, 06:12
Feb 14, 2022
Hi guys, I am trying to create a query that asks me for several data in a parameter.
For example, in my table I have 1, 2, 3, 4, 5 and 6 as data.
and I want a parameter that allows me to enter several data, to return me the numbers that I entered.


I’m here to help
Staff member
Local time
Yesterday, 21:12
Oct 29, 2018
Hi. Sorry can't give you the link right now, but try visiting my blog site and do a search on multiple value parameter.

I'll follow up later...

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:12
Feb 19, 2002
When you have to use InStr() or LIke, that should give you a clue that the suggested method isn't working as you need it to work. What you are ending up with is:

Where something In("1,2,3") which is NOT the same as
Where something In(1,2,3)

So, Instr() and Like * will work but they will both force full table scans which can be slow for large recordsets.

I've attached an example of building the SQL in VBA. This is one of the few situations where I use embedded SQL. There are three samples of how you would use the method. Don't forget to enclose items in quotes when they are strings rather than numbers.


    101.6 KB · Views: 177

Users who are viewing this thread

Top Bottom