Multiple Item query

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I've read a few posts on this query and it looks like creating a table
where I input the item numbers in it and linking it to the query seems
to be a good way to get a lot of items in a query. Now what If I have
hundreds of numbers I want to look up? do I input all 100 numbers into
the table? Or what if it's like 10 numbers but I want create seperate
queries for different groups of numbers, should I have 1 table for one
group of numbers? What would be the easiest way for a novice to do
this?
 
It is easier to fill the table with just the values you need for the query
you want to run, then, empty the table and refill it with new values for a
new query.

You can, though, make a table with two columns, one column for the values,
and the second column, a kind of QueryID:

TheValues QueryID
102 1
105 1
16 2
17 2
19 2



and you can then use:

WHERE QueryID = 1

to get 102 and 105, for a given query
and


WHERE QueryID = 2


to get 16, 17, and 19 for another query, without having to clear the table
EACH time. Note that you may still have to clear all records where queryID=2
before running the second query, with a new set of values, though. So, that
way of doing things is more susceptible to problems than using a simpler
approach. A better solution could be to use a different table for each
query, and to call the table like: Query1_parameters, and
Query2_parameters and have Query1_parameters holding parameters JUST for
Query1.



Hoping it may help,
Vanderghast, Access MVP
 
Thanks, this is what I did, I came to the fact that I have to enter in
the items and I created a class and subclass for easy searching. This
made my queries run a lot faster to.
 
Back
Top