Query Automation

D

DaveB

I have a Macro that runs 2 queries. The second query is a
totals query and runs off the results of the first query.

How do I get the results of the first query into the
second query, so the second query runs correctly?

Thanks.

DaveB
(e-mail address removed)
 
R

Rick Brandt

DaveB said:
I have a Macro that runs 2 queries. The second query is a
totals query and runs off the results of the first query.

How do I get the results of the first query into the
second query, so the second query runs correctly?

You don't have to do anything. When you use queries as the input to other
queries the "inner" queries are automatically run when the "outermost"
query us run.
 
D

DaveB

The second query is an existing query, how do I get the
results of the first query into the second so the data
comes out correct when the macro is run. Thank, I'm
struggling with this. DaveB
 
J

Joe Fallon

Rick's answer was 100% correct.
You should provide more information if it still does not work.

The idea is for you to first write 2 queries.
qry1 should exist in you Database window.
qry2 is built using qry1 as the "table".

So when you run qry2 from the Database window Access really runs qry1, feeds
the results automatically to qry2 which pops the final answer on your
screen.

The only thing that should be in the macro is a call to run qry2.
This just "automates" the step of you runing the query in the Database
window.
 

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