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!

Timer Event freezing Access

Status
Not open for further replies.

MitchJP

MIS
Feb 17, 2004
43
US
All:

I have this code in Access, which starts a timer, and after 15 seconds, the loop ends and the rest of the code is processed. Problem, the program locks up while this is looping... Any suggestions?

........
Dim PauseTime, Start

PauseTime = 15 ' Set duration.
Start = Timer ' Set start time.

Do While Timer < Start + PauseTime
Loop

DoCmd.RunMacro "mcrCloseForm"
........

After 15 seconds, the loop ends and the rest of the code is processed (runmacro). This timer allows me to delay the running of the macro by 15 seconds, but it locks up instead and I can't work during the 15 seconds.


Thanks!
MitchJP
 
Have you tried this ?
Do While Timer < Start + PauseTime
DoEvents
Loop

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I tried DoEvents and it seems to have fixed the problem! Thanks for the help!!

MitchJP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top