Execution delay

G

Guest

In my database I am using the Autoexec micro to run some queries.
In the middle of a series of queries, I am using the RunApp command
to run this Excel file: C:\Program Files\Microsoft Office\Office\Excel.exe
C:\Userdata\Tp25MCRO2.xls

The problem is this Excel file needs to finish before the next query starts.
The Excel file may take 1 to 5 seconds to complete.

Is there some kind of delay feature I can put between the RunApp
command and the next RunQuery command.

Thanks..Roland
 
A

Allen Browne

For a simple 5 second delay that yields processor time to the other program:
Dim dtContinue As Date
dtContinue = DateAdd("s", 5, Now())
Do while Now() < dtContinue
DoEvents
Loop

For a more comprehensive solution using API calls, see:
Shell and Wait
at:
http://www.mvps.org/access/api/api0004.htm
 

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