Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pausing access

Status
Not open for further replies.

Nordyck

Programmer
Aug 16, 2001
57
US
Is there a command that cause access to stop execution until the app it's called finish it's process. Below is the code that calls a batch file and in the last line of the batch file, it copies itself to a.txt. And then a wait must be given to allow the machine time to finish the copying before continuing to the next statement. This loop may be called anywhere from 1 to 20 times. Also, the data can be on the network and the processing time varies depending upon the import files and network traffic.

For i = 0 To gImportFileCount
If a(i, 0) Then
st = "test.bat " & j & ", " & a(i, 1) & ", " & a(i, 2) & ", " & a(i, 3)
Call Shell(gCamsDir & st, 0)
st = ""
While st = ""
st = Dir(gCamsDir & "a.txt")
Wend
If j = 1 Then j = 0
DelayEnd = DateAdd("s", 1, Now)
While DateDiff("s", Now, DelayEnd) > 0
Wend
Kill gCamsDir & "a.txt"
End If
Next i
 
You could use the file system object to look for a.txt. Keep looping until the file exists then proceed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top