Full Version: Timer/SLeep function in Access
UtterAccess Forums > MicrosoftŪ Access > Access Date + Time
Punker
Hi guys,
I have built an Access form, with a button that calls several different outside applications, my problem however is that it is executing through all of the code within the btn_click event too fast, before the outside programs are done executing. I was wondering if there is a sleep/pause function in VB that I could use. I am fairly new to VB, so it would be awesome if someone could provide a code snippet!
Thanks
freakazeud
Hi,
search UA. There have been many discussions on this e.g.:
01
02
03
...
HTH
Good luck
iandouglas
One solution that suits me is the sub below. Call it with the number of seconds you want to pause your code & it'll do just that!
Public Sub Pause(intWaitTime As Integer)
Dim dtTimerExpired As Date
dtTimerExpired = DateAdd("s", intWaitTime, Now())
Do Until Now() >= dtTimerExpired
DoEvents
Loop
End Sub
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.