Question : timer object in ms access

I have an ms access application that has numerous form with timers i wanted to use a global timer like the one found at http://vb.mvps.org/samples/project.asp?id=TimerObj  to avoid the form timers,can this be done?Also is it possible to have them trigger at different intervals.Thanks

Answer : timer object in ms access

what about creating a timer in vba?
add following in a module
startthattimer returns a value this is your timerid. ensure u set the function to call in there
killthatimer stops timer with specifid id

Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long

'0 return means failure
Public Function StartThatTimer() As Long
    StartThatTimer = SetTimer(0, 0, 1000, AddressOf MyTimerProc)
End Function

Public Function StopThatTimer(ByVal lTimerID As Long)
    StopThatTimer = KillTimer(0, lTimerID)
End Function

Public Sub MyTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
    MsgBox "Koochi Koochi Koo"
End Sub

Random Solutions  
 
programming4us programming4us