As my report opens, this code runs:
Private Sub Report_Open(Cancel As Integer)
sdate = InputBox("Please Enter Shift Report Start Date", "Report Start Date")
edate = InputBox("Please Enter Shift Report End Date", "Report End Date")
If IsDate(sdate) = True And IsDate(edate) Then
Me.Filter = "[QryShifts].[ShiftDate] Between #" & Format(sdate, "dd/mm/yy") & "# And #" & Format(edate, "dd/mm/yy") & "#"
Else
Me.Filter = ""
End If
End Sub
The sdate and edate work ok as the input dates are displayed in the report header but the results returned from the query are not limited to the dates, all the data records in the query are displayed in the report.
Can anyone tell me where my error is?
Thanks
Tyler
Private Sub Report_Open(Cancel As Integer)
sdate = InputBox("Please Enter Shift Report Start Date", "Report Start Date")
edate = InputBox("Please Enter Shift Report End Date", "Report End Date")
If IsDate(sdate) = True And IsDate(edate) Then
Me.Filter = "[QryShifts].[ShiftDate] Between #" & Format(sdate, "dd/mm/yy") & "# And #" & Format(edate, "dd/mm/yy") & "#"
Else
Me.Filter = ""
End If
End Sub
The sdate and edate work ok as the input dates are displayed in the report header but the results returned from the query are not limited to the dates, all the data records in the query are displayed in the report.
Can anyone tell me where my error is?
Thanks
Tyler