P
Paul B.
I do not know why this is happening....the code below works if there is no
dates selected in either txtStartDate or txtEndDate, but if there are dates,
then I get an error the the OpenForm action was canceled.
How would I debug this? Any ideas?
Thanks in advance....
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDispositionHistory"
If IsNull([txtStartDate]) And IsNull([txtEndDate]) Then
stLinkCriteria = "[VehicleNumber]=" & Me![VehicleNumber]
Else
stLinkCriteria = "VehicleNumber='" & Me!VehicleNumber & "' And " &
"DispositionDate >= #" & Format$(Me!txtStartDate, "dd/mm/yyyy") & "# OR " &
"DispositionDate <= # " & Format$(Me!txtEndDate, "dd/mm/yyyy") & "#"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
dates selected in either txtStartDate or txtEndDate, but if there are dates,
then I get an error the the OpenForm action was canceled.
How would I debug this? Any ideas?
Thanks in advance....
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDispositionHistory"
If IsNull([txtStartDate]) And IsNull([txtEndDate]) Then
stLinkCriteria = "[VehicleNumber]=" & Me![VehicleNumber]
Else
stLinkCriteria = "VehicleNumber='" & Me!VehicleNumber & "' And " &
"DispositionDate >= #" & Format$(Me!txtStartDate, "dd/mm/yyyy") & "# OR " &
"DispositionDate <= # " & Format$(Me!txtEndDate, "dd/mm/yyyy") & "#"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria