Frozen form with long process

X

Xav

I've got a simple application with one button control in my form that
triggers a few queries which take a few minutes to run. I use a label
control to display the information about which query is currently
running. My problem if I swap to any other application and come back to
Access I got a nice/annoying white screen. I would also like to be able
to abort the process at any time. Any idea?

Thanks,
 
D

Douglas J. Steele

Try putting in some calls to the DoEvents function.

DoEvents passes control to the operating system. Control is returned after
the operating system has finished processing the events in its queue and all
keys in the SendKeys queue have been sent.
 
K

Klatuu

In additions to Douglas' recommendation, you may try an occasional Me.Repaint
I have had the same issue with some long running process.
 
X

Xav

Thank you both for your advice. Actually those information don't fix my
white screen problem when I swap to another application (IE for
instance) and bring up back MS Access (while still processing). Is
there a way to run a query in a independant thread in order to free the
Form from any work? (Same problem if I want to move the Form when it is
running a long query, the form is just stuck waiting the process to
finish).
 
K

Klatuu

If you are executing a query that take a long time to process, then there is
not much you can do about that because your code is waiting for the query to
complete execution.
I don't know if this would improve the circumstances or not, but I had a
thought. (weigh in here Douglas) If you put the code that executes the query
in a hidden form, then rather than run the query from your visible form, open
the hidden form and have it execute the query. It might be necessary to pass
focus back to the visible form before the query actually starts running.
Again, I have no idea if this will work, it is only an idea.
 

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