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

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?
 
T

Tom van Stiphout

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top