Run all queries in a group

  • Thread starter Thread starter CFitz
  • Start date Start date
C

CFitz

Is there any way to run all of the queries that are in a group? I could
always make a macro that runs each query but it'd be easier if there was just
one action. I have about 40 update queries that need to run.
 
Is there any way to run all of the queries that are in a group? I could
always make a macro that runs each query but it'd be easier if there was just
one action. I have about 40 update queries that need to run.

Use code.
CurrentDb.Execute "QueryA", dbFailOnError
CurrentDb.Execute "QueryB", dbFailOnError
CurrentDb.Execute "QueryC", dbFailOnError
CurrentDb.Execute "QueryD", dbFailOnError
etc.

Or if you name each update query in sequential order, i.e.
"Query1","Query2","Query3", etc. you can loop through them quite
simply:

Dim strName as String
Dim intX as Integer
For intX = 1 to 41
strName = "Query" & intX
CurrentDb.Execute strName, dbFailOnError
Next intX
 
Back
Top