search multiple values from one field

J

jackie

I am using filter by form. Is there a way to allow my user to enter multiple
values into a search box. Our company assigns numeric values to customers.
Some users may want to enter multiple customer numbers. For example:

W33mrg
W45T54
N34T59
W549K2
I tried entering a comma after the first customer number, but it brings back
no data. Thanks.
 
A

Allen Browne

The query engine won't be able to match multiple values against the field.

You would need to use some VBA code to parse the values, and build a string
to use to filter your form/report. Use Split() to parse the values, and then
loop through the array building up the string to use with the IN operator.
The target string would this kind of thing:
[CustNum] IN ("W33mrg", "W45T54", "N34T59", "W549K2")
 
Top