Here is one function that will count whole seconds. IF you want t count 2 or more seconds, this will work. It is just not very accurate because it does not understand how to manage fractions of a second. So if you have it count 3 seconds, it might only count for a little longer than 1 or it might count just under 4 seconds.
Code:
Private Sub pleaseWait(intDelay As Integer)
Dim dblDelayTill As Double
dblDelayTill = DateAdd("s", intDelay, Now)
While DateDiff("s", Now, dblDelayTill) > 0: Wend
End Sub
If you need to count fractions of a second, you can place the following in its own Standard module.
Code:
Option Compare Database
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Sub PauseCode(MillisecondsCount As Long)
Sleep MillisecondsCount
End Sub