Running a continuous VBA loop while allowing the user to click but

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

I want to run a VBA loop that increments a progress bar but allow the user to
click buttons on the same Window that activated the loop to perform various
actions. I've tried the standard Timer loop using DoEvents but sometimes
clicking the buittons works and sometimes it doesn't. Any suggestions?
 
On Thu, 3 Jun 2010 15:22:14 -0700, David W

The timer event is very low priority, so even if you specify it to
tick every 1000 msec that won't necessarily happen if you're in a
tight loop. The only way to make the UI more responsive is to yield to
Access/OS more frequently. The Sleep API and DoEvents do that.

If you want even more control, you should look at other programming
environments such as .NET which support multithreaded applications.

-Tom.
Microsoft Access MVP
 
Back
Top