Query prompt one column for multiple random values

R

rcs

I can write a query that prompts one field for a specific value, but would
like user to enter multiple criteria

Example - Lot numbers range from 1 to 140

transportation back to original consignor is provided by one individual, he
is picking up lots 2, 50, 76 and 32 so I want to have these values on the
load out ticket

How do I allow for nonconsecutive values to be entered?
 
J

John Spencer

You could use a where clause that looked like the following. Replace
LotNumber with the name of your field.

WHERE Instr(1,"/" & [Enter lot numbers separated by slashes 1/2/53] & "/","/"
& [LotNumber] & "/") > 0


In query design view that would probably look like:
Field: Instr(1,"/" & [Enter lot numbers separated by slashes 1/2/53] & "/","/"
& [LotNumber] & "/")

Criteria: > 0

A better solution would involve VBA and building the query string (or at least
the where portion of the query) after the user enters choices on a form.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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

Top