Link to home
Start Free TrialLog in
Avatar of careybroph
careybrophFlag for United States of America

asked on

VBA ~ Form doesn't refresh while doing intense background processing...

I have an MS Access form that is used for managing some file processing (under the hood, it's reading various text files and updating tables with data from those files). As it's processing each file, I have some code that updates a text box on the form to provide the status (e.g. "Processing file 3 or 9").

Before starting, I prompt them with a yes/no message box to confirm that they want to process their data (it can take awhile).

However, when they click "Yes" (continue), the message box doesn't go away and the status text box doesn't update until AFTER it's completed processing. Not exactly what I was looking for!

I'm sure it's because it is just crunching so hard in the background that it's not updating the form along the way.  I've added a 'refresh' command, but that didn't seem to help.

I know I've seen something on this before (possibly a magazine or something).  Maybe using a timer (am I getting warmer?).  I've done some searching online, but didn't find anything.  Time to call in the experts.

Thanks in advance for the help.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of careybroph

ASKER

repaint didn't work.

DoEvent did help.  After it completed the first cycle it repainted the screen.  I need to tinker around with it a bit to get the message box to disappear right away, but that shouldn't be too difficult.

THANKS for the quick help (and on a Friday even!).  Nice way to end the week!
THANKS Again!