Macro to pause after each query

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?
 
G

Guest

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
 
S

Steve Schapel

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?
 

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