search multiple values from one field

  • Thread starter Thread starter jackie
  • Start date Start date
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.
 
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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top