Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait Time Between Actions in Code 1

Status
Not open for further replies.

SKIGAL

Technical User
May 12, 2003
11
US
Thanks in advance for your assistance.

I am performing several actions in an event procedure. One is opening a "HOLD" form, informing the user that activity is on hold until the actions are completed.

My problem is, since the actions perform one right after another, my form does not have time to be viewed before the screen is locked by the next step (a lengthy query).

Question: Is there a way to make MSAccess 97 wait a few seconds before performing the next step?
 
Hi!

You can "hold" program execution by for instance:

dim dtTime as date
dttime=now
do while now < dateadd(&quot;s&quot;,5,dttime)
loop

- assigns current time to variable
- checking the variable against itself + 5 seconds

But - shouldn't you perhaps consider other methods of telling your users that something is going on?

- a progress bar
- a texbox/label in you current form...

You might also consider posting the question in a &quot;pure&quot; access-forum, ie forum705

Roy-Vidar
 
Hi SKIGAL,

It's not really a wait that you want. Your Form is 'displayed' but the services required to completely refresh the screen so that the user can see it, are waiting for your code to let them run. After the openform add the line:

DoEvents

All should then work as you want.

Enjoy,
Tony
 
Thanks, RoyVidar. You have a point. But this db is very simple and I didn't want to go too in-depth.
 
TonyJollans,

Thanks so much! That was EXACTLY what I needed! This was my first time to use this site for my own thread. You've been very helpful and I really appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top