View Full Version : Running access queries in sequence through Macro


bclmx
07-22-2009, 07:01 AM
Hey Guys,

I was wondering if there is a way to run queries automatically in sequence through Macro.
Basically what I need is to automatically run query 1 then query 2 once the query 1 has finished and then the query 3 once the query 2 is done.
Any idea how to do this? Is the only option VBA code?
Any help would be greatly appreciated.

Andy

pbaldy
07-22-2009, 07:13 AM
Personally I would use code, but you can have more than one in a macro. Just repeat the action.

AtLarge
07-22-2009, 09:20 AM
Personally I would use code, but you can have more than one in a macro. Just repeat the action.

So your saying the macro will not continue until the query is finished?

Does this go for macros calling macros too?

Is there an advantage to having one macro that calls out each individual queries or macros as opposed to having one macro start up and then the last function is to call the next macro? Like daisy chaining them together.

TIA.

pbaldy
07-22-2009, 09:32 AM
Yes, I'm saying it should wait for a query to finish before starting the next, and it would work the same way for calling a macro.

I don't use macros, but the only reason I could see for "daisy chaining" them would be if certain macros could be called from different places, and you wanted to avoid having the same process in multiple macros. This would be similar in concept to when we create a public function in code. Other than that, you'd be creating unneeded objects and bloating the database.

AtLarge
07-22-2009, 09:44 AM
That's cool. My only thought is that it might be easier to troubleshoot later if you had one macro calling many to step through as opposed to one that calls another that calls another that calls another, etc. Either way my biggest concern was that it would start another process before the last one finished because it could effect the results. Thanx Paul!