Update form while procedure is running

G

Guest

I have a form that has a command button that runs a SQL stored procedure. The
sp can take some time to complete, so I want to display an elapsed time
counter on the form while the sp runs. I'm using the OnTimer event and have
written all the code to count the elapsed time and display it in a control on
the form. The problem is, I can't get the form to update and show the elapsed
time until the sp has quit running--which totally defeats the purpose of
showing the elapsed time *while* the sp is running.

Is there a way to update/repaint the form while the sp is running?

Thanks,
Mike
 
B

Brendan Reynolds

I haven't personally used the feature, but I understand that you can use ADO
to execute a command asynchronously, which might resolve your problem. (You
may also need to include a call to DoEvents immediately after the code that
updates the form). See the ADO documentation in the MSDN library for
details.
 
G

Guest

Thanks, Brendan. "Asynchronous ADO" is exactly the hint I needed. I found a
good discussion of this topic in "Microsoft Access Projects with Microsoft
SQL Server" by R. Albrecht and N. Nicol and was able to solve my problem.

Mike
 

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

Similar Threads


Top