Releasing processor usage from loop

davesmith202

Employee of Access World
Local time
Today, 00:49
Joined
Jul 20, 2001
Messages
522
How do you let your PC get a little bit of CPU time back again, when in a long vba loop? Knew this before but forgot!

Dave
 
Are you enquiring about DoEvents or are you referring to breaking out of a loop?
 
Last edited:
Ahh that sounds familiar! Will check out DoEvents thanks.
 
its this sort of thing


for x= 1 to somevalue
dostuff
doevents
end


without the doevents the access app will "lock" until the loop finishes. which may be exactly what you want in some cases - ie put the hourglass up, and wait - or include a progress meter.

adding the doevents lets access deal with other events - so you can continue to interact with the app - which may improve the user experience - but you need to be careful in case you do stuff that may affect the loop itself.
 

Users who are viewing this thread

Back
Top Bottom