Function that pauses program execution

ipr1

Registered User.
Local time
Today, 21:30
Joined
Jun 13, 2003
Messages
31
I have the following code:

Option Explicit
Function Wait (Delay As Integer, DispHrglass As Integer)
Dim DelayEnd As Double
DoCmd.Hourglass DispHrglass
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd)>0
Wend
DoCmd.Hourglass False
End Function

This function work when I test it (e.g. type: ?Wait(10,7) and "enter" in the Immediate Window. However, I want to hard code those values into the code shown above.

Where and what should I put in?

Thanks for whatever help you can provide.
 
Hi - Thanks for the response. However, the code I used worked during my testing. My specific concern is where and how do I hard code in the integers that I want to make it work for the delay and the display of the hourglass.

Thanks.
 
Function Wait()

Dim Delay As Integer
Dim DispHrglass As Integer

Delay = 10
DispHrglass = 7

Dim DelayEnd As Double
DoCmd.Hourglass DispHrglass
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) > 0
Wend
DoCmd.Hourglass False
End Function

?or define the two variables where they are accessible to the whole of your project?
 
THANK YOU OPM Coordinator - it worked like a charm!!!

Everybody - have a great weekend.
 

Users who are viewing this thread

Back
Top Bottom