I have a timer on my form that refreshes records and notifies another user that a record has been added. recently i have been getting a runtime error 91 - object variable with block variable not set, why would this have started to happen. This is the code i am using and the error is on the line ** at each end
Private Sub Form_Timer()
'This procedure uses functions from the Windows API.
'The declarations for these procedures are found in the Module
'within this database and documented on the Microsoft Windows
'Programming site.
'FindWindow, GetForegroundWindow, SetForegroundWindow, Sleep
Dim intNew As Long
Dim hwnd As Long
Dim hwndCur As Long
Dim intLoop As Integer
Dim retval As Long
**intcount = Forms("frmTracker"
.Recordset.RecordCount**
Forms("frmTracker"
.Requery
intNew = Me.Recordset.RecordCount
hwnd = FindWindow(vbNullString, "frmTracker"
hwndCur = GetForegroundWindow()
If (intcount <> intNew) And (hwnd <> hwndCur) Then
SetForegroundWindow hwnd
Forms("frmTracker"
.Recordset.MoveLast
intcount = Forms("frmTracker"
.Recordset.RecordCount
For intLoop = 1 To 5
Beep
Sleep 5000
Next intLoop
End If
End Sub
Private Sub Form_Timer()
'This procedure uses functions from the Windows API.
'The declarations for these procedures are found in the Module
'within this database and documented on the Microsoft Windows
'Programming site.
'FindWindow, GetForegroundWindow, SetForegroundWindow, Sleep
Dim intNew As Long
Dim hwnd As Long
Dim hwndCur As Long
Dim intLoop As Integer
Dim retval As Long
**intcount = Forms("frmTracker"

Forms("frmTracker"

intNew = Me.Recordset.RecordCount
hwnd = FindWindow(vbNullString, "frmTracker"

hwndCur = GetForegroundWindow()
If (intcount <> intNew) And (hwnd <> hwndCur) Then
SetForegroundWindow hwnd
Forms("frmTracker"

intcount = Forms("frmTracker"

For intLoop = 1 To 5
Beep
Sleep 5000
Next intLoop
End If
End Sub