Access 97/2000 screen refresh (VBA)

M

Markus

Hi all,

I would like to display the progress of a complex
operation, which takes several minutes to complete. The
problem is, Access simply won't do screen refreshes during
the process. I tried using the status bar, which updates
for about 15 seconds and then also freezes. "Repaint" or
"Requery" or "Application.Echo" methods won't help either.

Is there any way to make Access "take a breath" to do a
full screen refresh and then resume with the function?

Any help appreciated, thanks in advance!

- Markus
 
W

Wayne Morgan

Place the command

DoEvents

in the routine. The placement is the trick. If you have a loop that is
taking a long time to complete, place this in the loop. If it is just a long
routine (a bunch of lines of code) you may want to place a few of these in
it. However, if what is taking so long is a single call, this won't help.
For example, if you are running an update query and that query takes two
minutes to run, once you've called the query, about all you can do is sit
back and wait. You would have to warn the user first. The exception would be
if that single call was to another routine. If so, then you would place the
DoEvents in that other routine.

If you are trying to update a status bar, placing the DoEvents right after
the status bar update call may be a good place for it.
 

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