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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wait() ? 1

Status
Not open for further replies.

evilmousse

Programmer
Apr 15, 2003
85
0
0
US


i need a vba wait(millisec) command for access.

doesn't seem to exist.

suggestions?

-g
 
You asked for milliseconds and I don't have an example for that, but if you can use seconds, try the following:

Dim doubStart As Double

DoCmd.Hourglass True
doubStart = Timer
Do While Timer < doubStart + 5 '--5 SECONDS
DoEvents '--OP SYS RUNS OTHERS
Loop
DoCmd.Hourglass False

Beep

HTH,
Bob
 
Bob

I had a similar problem and this worked great. Enjoy the star.

Thanks!

Jim DeGeorge [wavey]
 
Thanks for the star, Jim!

Don't know why I didn't think about the routine handling milliseconds...

Do While Timer < doubStart + 5 '--5 SECONDS

could just as easily read

Do While Timer < doubStart + .005 '--5 MILLISECONDS

Maybe I know why I didn't think of it - 5 milliseconds wouldn't be much of a pause in a user interface!
 
ordinarily, yes.
i happened to have been using access
in a more server-side role, dumb as that
is, to generate website-downloadable reports
in PDF. On the multi-processor server,
the subtasks of outputting to postscript and
then converting to pdf were overlapping,
converting the same ps to pdf twice before
the next ps could be made. A second pause
was sufficient, but 1 report creation per
second added up to an unreasonable length
of time for the export to pdf routine to run,
so i wanted to try to shave that second down
a bit.

yeah, the need for millisecond pauses is unusual,
but not nonexistant.

-g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top