You may need to use the code timer SetTimer and KillTimer API function.
Code:'Code under Basic Module File Option Explicit Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) MsgBox "Time UP!" End Sub Private Sub Form_load() '1 second = 1000ms '1 min 5 sec = 65000ms "Create a Code Timer SetTimer Me.hwnd, 0, 65000, AddressOf TimerProc End Sub Private Subn Form_QueryUnload() 'Kill the Code Timer KillTimer Me.hwnd, 0 End Sub




Reply With Quote