DoEvents appears not to work

J

Jeff C

I have the following:
Function M5_Process()
DoCmd.SetWarnings False
Call Shell("C:\ScheduledTasks\01.bat", 1)
DoEvents
Call Shell("C:\ScheduledTasks\02.bat", 1)
DoEvents
DoCmd.RunMacro "M1_BringInData", , ""
DoEvents
DoCmd.RunMacro "M2PrintReport", , ""
DoCmd.SetWarnings True
End Function


The first Call Shell runs 01.bat that takes about 15 seconds to execute.
Even with the DoEvents, the second Call Shell begins executing 02.bat.
o2.bat relies on 01.bat having been executed so I am getting error.

What is causing DoEvents to fail? Thanks in advance.
 

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