Multiple queries

J

JBF

Hello, I'm wanting to set up a query that will pull a different criteria each
time, based upon what I enter. I have customer locations sorted by route
codes, and I instead of select each individual route code, I'd like to be
able to enter a string of routes to pull the information. What do I need to
do to set this query up?
 
H

hackmn_g

JBF- I'm not an advanced user, but these discussion boards have saved my life
on a lot of things. So I owe it to the discussion boards to try to help when
I can.
Assuming I understand your question, your query will consist of three fields
(and maybe more that you didn't mention). Customer, Location, and Route.
You want to pull several different Routes in your query. In essence, you
need to query on multiple Routes.

In your Criteria line in the query design, type in the first route under the
Route field. On the Or line, type in the second route. On the (blank) line,
type in the third route. And so on. Or you can use a wildcard (*) on your
Criteria lines. Please clarify if your question is more involved.
 
J

Jackie L

It is usually best to refer to fields on a form instead of hard-coding
criteria into a query. If you create a bound or unbound field on a form
(like BegDate) then refer to that field in your query by using the expression
builder. It would look something like
Forms![frmInputForm]![BegDate]

Hope this helps.
 
J

JBF

That does help, but I'm wondering if there is something I could input in the
Criteria so I would be able to input a list of routes, For example:

If I wanted to pull just routes 105, 123, 124, and 197. I could enter that
and it would return the requested info. Right now I have a query to select
one route, and I I have to run this query for each individual route I need
the info. BUt if I could enter in the routes I needed and have it populate in
that order that would be great. Any help would be great.
 
Top