Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Multipal append Queries 1

Status
Not open for further replies.

cbiker

Programmer
Jul 2, 2003
35
US
I have an database that has a bunch of append queries that will take the information from one DB (PDDatabak)and put it in another (PDData)its kind of a pain to click on each qry. Is there any way to run them all without having to write an DoCmd for each Query.
any help will be appreciated
 
cbiker
There may be other ways, but the way I have done it is to run the queries, in a batch, from a command button on a form.

In the Click event for the command button, put a DoCmd line for each query that you want to run, and it will run each one in order.

You may wish to place a "DoCmd.SetWarnings False" prior to the DoCmd lines to run the queries. Otherwise, the warnings message will pop up with each new query. But also remember to put a "DoCmd.SetWarnings True" after the line for the last query you run.

Hope that helps.

Tom
 
In the past I have created a table with fields for query name, category, sequence, records affected, and run time. I wrote a query that pulls the records for a certain category sorted by the sequence field. I pass this query to some VB code which runs each query in the recordset, updating the records affected and run time each pass. Very handy for automating several processes and checking where bottlenecks are.

I think I had an Exclude yes/no field so I could skip certain queries without having to remove them from the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top