Query using a table as criteria

N

Neil Warwick

I'm sure there's someoone out there than can help me with
a little problem I'm having.

In my database I have a list of supplier names that are
held in a table (approx 80 entries). I need to produce a
report for each of the suppliers which will obviously need
to be based on a query of the main data table.
Is there a way I can write just one report / query that
will select each of the suppliers in turn as one of the
query criteria, then move onto the next supplier, rather
than having to write about 80 queries and then run them
from a macro (I've done this for 5 suppliers as a trial,
but doing it for 80 will take tooo long and I suspect
bloat my database too much)

Any help is much appreciated.

Thanks

Neil
 
S

Steve Schapel

Neil,

Yes, just use one query and one report. When you go to print the
report, just use the Where Condition argument of your OpneReport macro
to specify the supplier you want the report for. Alternatively have an
unbound textbox or combobox on a form to select the supplier you want
the report for, and then refer to this in the query criteria using
syntax such as [Forms]![NameOfForm]![NameOfCombo]. If you will want to
print the report for all suppliers at once, this is related to your
report design... you would use the Sorting & Grouping feature to put a
Supplier Header and Footer in the report, and force a new page after the
Supplier Footer... so you are really only printing one 80-page report,
one page for each supplier, but the final result will be no different
from 80 individual reports.
 
L

Les

Hi Neil,
It would be helpful if you gave a little more
information regarding your "main data table". What does
it contain? How do you relate it to your suppliers? How
did you relate your 5 suppliers to the main data for your
trial?
 

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

Similar Threads


Top