Macro to pause after each query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that runs about 15 queries. The problem I have is they all
prompt in the beginning of the macro and all run at the same time.
Is there a way I can have the macro pause after each query?
 
Hi,
create a new module, copy/paste this in it, save and close:

Option Compare Database
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Now anywhere in your db you can call Sleep(milliseconds) and it the code
execution will stop for the amount specified.
If you are using a macro I guess you can add RunCode actions between your
query call actions and use Sleep(1000) which would stop for one second, or
increase to whatever amount you want.
HTH
Good luck
 
Michael,

In a macro, I would do this using the Timer event of the form you are
acticating the macro from.

But can you say a little more about what the problem is. Why do you
need the pause? The queries won't run "at the same time", they will be
sequential, it's just that the sequence is quick :-) ... so what's wrong
with that? Can you give an example?
 
Back
Top