Timer

  • Thread starter Thread starter Jess
  • Start date Start date
J

Jess

Sometimes I need access to wait a few seconds until another task is
completed. How can I code this? Can anybody post an example?

Thanks
 
To be honest, how you wait will usually depend on why you have to wait.

For example, if you're using Shell to start an external task and you want to
ensure that it finishes before you continue, you'd use code like
http://www.mvps.org/access/api/api0004.htm at "The Access Web"

On the other hand, if you're running a VBA routine internal to your
application, you'd do something different.
 
Can you give an example of what you are doing where you need to do this?

One way would be to create a hidden checkbox on you Splash screen. Prior to
executing the code that takes a few seconds to process, you could set this
checkbox to true. Then, once the process that takes a few seconds is
complete, you would set this value to false.

Finally, in the code that appears to be executing too soon, you could check
to see whether the checkbox is true, and just execute a loop until that value
is false, something like:

While form_frm_Splash.chk_Pause = True : DoEvents : Wend

...More code here.
 
Back
Top