Can anyone help me with this subroutine:
Sub setdater()
If IsDate(Me.DaterBox1) Then MyDate1 = Me.DaterBox1 Else MyDate1 = Now()
If IsDate(Me.DaterBox2) Then MyDate2 = Me.DaterBox2 Else MyDate2 = Now()
End Sub
It errors out on If IsDate(Me.DaterBox1) Then
I get the runtime error 2467 - this expression refers to an object that is closed or doesn't exist.
My database is large with several reports running off of the switchboard automatically on a timer. When I run the reports individually they run fine but when I use the timer on my switchboard it bombs at this subroutine.
All the routines use this and run fine individually:
Call setdater
If IsDate(Me.DaterBox2) And IsDate(Me.DaterBox1) Then
Gvarday1 = MyDate1
Gvarday2 = MyDate2
Else
Gvarday1 = DateAdd("d", -1, Format(MyDate1, "mm/dd/yy"))
Gvarday2 = Format(MyDate1, "mm/dd/yy")
End If
Thanks.
Sub setdater()
If IsDate(Me.DaterBox1) Then MyDate1 = Me.DaterBox1 Else MyDate1 = Now()
If IsDate(Me.DaterBox2) Then MyDate2 = Me.DaterBox2 Else MyDate2 = Now()
End Sub
It errors out on If IsDate(Me.DaterBox1) Then
I get the runtime error 2467 - this expression refers to an object that is closed or doesn't exist.
My database is large with several reports running off of the switchboard automatically on a timer. When I run the reports individually they run fine but when I use the timer on my switchboard it bombs at this subroutine.
All the routines use this and run fine individually:
Call setdater
If IsDate(Me.DaterBox2) And IsDate(Me.DaterBox1) Then
Gvarday1 = MyDate1
Gvarday2 = MyDate2
Else
Gvarday1 = DateAdd("d", -1, Format(MyDate1, "mm/dd/yy"))
Gvarday2 = Format(MyDate1, "mm/dd/yy")
End If
Thanks.