OnTimer event stops

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a hidden form that runs a number of programs on a set interval, but
from time to time it just stops without any error messages. Only way to get
it going again is to stop the application and restart it.

Anybody seen this and know a cure?
 
Is an error occurring during the operation of the program that is being run?
What is the code for the timer event? What else are you doing in the
database while the timer code is running?
 
Ken,

The application does have another form that also has an ontimer event, but
as far as I know there was no errors.

Private Sub Form_Timer()
On Error GoTo HandleErr
Me.Requery
Me.TimerInterval = Me.UpdateInterval

FindESBWork
SendToDataRocket
ImportESB
ProcessESB
AutoSchedule

ExitHere:
Exit Sub
' Error handling block added by VBA Code Commenter and Error Handler Add-In.
DO NOT EDIT this block of code.
' Automatic error handler last updated at 04 May 2004 08:42:57
HandleErr:
If Err.Number <> 2501 Then
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE [My Company Information] SET MMaxError =
'MobileMax: Form_Timer-> " & Err.Description & "'"
DoCmd.SetWarnings True
ReportError "Error " & Err.Number & ": " & Err.Description,
"Form_ESB.Form_Timer"
End If
Resume ExitHere
' End Error handling block.
End Sub
 
Ken,

I just made the following change:

If Me.UpdateInterval < 30000 Then
Me.TimerInterval = 30000
Else
Me.TimerInterval = Me.UpdateInterval
End If

to ensure no 0 sneaks in on the TimerInterval I made this change to see if
it helps.

RGDS
Morten
 
Two things come to mind:

(1) The value of UpdateInterval field/control is being reset to 0 somehow.

(2) An error is occurring in one of the called subroutines that somehow is
stopping the code from running.

--

Ken Snell
<MS ACCESS MVP>

Morten said:
Ken,

The application does have another form that also has an ontimer event, but
as far as I know there was no errors.

Private Sub Form_Timer()
On Error GoTo HandleErr
Me.Requery
Me.TimerInterval = Me.UpdateInterval

FindESBWork
SendToDataRocket
ImportESB
ProcessESB
AutoSchedule

ExitHere:
Exit Sub
' Error handling block added by VBA Code Commenter and Error Handler Add-In.
DO NOT EDIT this block of code.
' Automatic error handler last updated at 04 May 2004 08:42:57
HandleErr:
If Err.Number <> 2501 Then
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE [My Company Information] SET MMaxError =
'MobileMax: Form_Timer-> " & Err.Description & "'"
DoCmd.SetWarnings True
ReportError "Error " & Err.Number & ": " & Err.Description,
"Form_ESB.Form_Timer"
End If
Resume ExitHere
' End Error handling block.
End Sub


Ken Snell said:
Is an error occurring during the operation of the program that is being run?
What is the code for the timer event? What else are you doing in the
database while the timer code is running?
--
 
Back
Top