Pause until outside program Finishes (1 Viewer)

Loony22

Registered User.
Local time
Today, 18:44
Joined
Nov 30, 2001
Messages
40
Hello,

In my current db, im using rar.exe application (with shell command). After downloading Api script for making access sleep for a period of time the Rar application is working just fine (compressing). However, there might be a case when period of time is not sufficient. In that case, the application won't do it job. Question is how can I pause the code until outside application finishes it job and then continue with the rest of the code. I read that doevents can do the trick but I really don't know how to use it.
 

Rob.Mills

Registered User.
Local time
Today, 13:44
Joined
Aug 29, 2002
Messages
871
The DoEvents cmd is pretty simple to use. What it does is when different tasks get in line for the processor to go through it will stop the code in your db and tell the processor to work on everything else that's in line before coming back to the db. Very useful when using code that takes time like loops.

All you do is add an extra line where you want the code to do this and type:

DoEvents

That simple.
 

Loony22

Registered User.
Local time
Today, 18:44
Joined
Nov 30, 2001
Messages
40
Thank you For your help.
I tried putting the command line : "Doevetns" after running rar.exe . However, its not working. The application exits fast, without compressing the file.

* With the access sleep module, the application is running fine.
However, i don't want to use this module (Reason in my first post).
 

Rob.Mills

Registered User.
Local time
Today, 13:44
Joined
Aug 29, 2002
Messages
871
Oops. :(

To be honest I don't know much about the other things you are trying. I've just used the DoEvents command before. Maybe it won't work with what you're doing. Sorry about that.
 

Loony22

Registered User.
Local time
Today, 18:44
Joined
Nov 30, 2001
Messages
40
u must have misunderstood me. I don't want the program to pause for number of seconds i choose (i can already do that with the sleep function). I want the program to freeze as long as other application is running. there might be a case that it will take for the program to finish it job 5 seconds, or 3 or 10 , depends on media inserted, size of Db.

Any other option??
 

RichMorrison

Registered User.
Local time
Today, 12:44
Joined
Apr 24, 2002
Messages
588
When you shell to start another program, Windows creates a "handle" for the program. There is a technique to loop until the handle goes away.

I can't find a code example anywhere, but it can be done.

not much help,
RichM
 

Fuga

Registered User.
Local time
Today, 19:44
Joined
Feb 28, 2002
Messages
566
Being a nitwit on VBA programming, I did this.

using the line

Interaction.appactivate "nameofwindow"

to produce an error (ie there is no window with that name)

and then write whatever you like in the errorcode.

Fuga.
 

Users who are viewing this thread

Top Bottom