Article ID: 141537
Article Last Modified on 1/19/2007
'**********************************************************
' Declarations section of the module
'**********************************************************
Option Explicit
'===================================================================
' NOTE: In Visual or Access Basic the unit of greatest precision
' is seconds. Therefore if the Timer is set to wait one second, the
' result could be a delay of anywhere from 0 to 1 second. If a higher
' degree of precision is required, another option is to use the Timer
' event of the form which has the ability to trigger every 1000th of a
' second.
'====================================================================
Function Wait (Delay As Integer, DispHrglass As Integer)
Dim DelayEnd As Double
DoCmd.Hourglass DispHrglass
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass DispHrglass)
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) > 0
Wend
DoCmd.Hourglass False
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass False)
End Function
97514 ACC: Writing Functions Called from Events or Expressions
Keywords: kbhowto kbprogramming KB141537