hi
i have a report that is bound to a query, what im trying to do is open this report based on different dates.
so i have two buttons on a form, these buttons have some VBA to fill a field on the report, this field is then used in the query to filter the data
so the button vba is
this inserts the date and time into a field on the report called txtSecondDate
there is a field on the report called txtFirstDate with a default value of Date()-1 + #02:00:00#
in the query i have two fields called MCUDate and MCUTime, i have concatenated these two fields together like this
then in the criteria of this field i have
but it doesnt filter the data
when i remove the time, it works fine, but i need to filter by time aswell.
does anyone have anysuggestions?
i have a report that is bound to a query, what im trying to do is open this report based on different dates.
so i have two buttons on a form, these buttons have some VBA to fill a field on the report, this field is then used in the query to filter the data
so the button vba is
Code:
Private Sub btnYesterday_Click()
On Error GoTo btnYesterday_Click_Err
DoCmd.OpenReport "Report_ENG_MCU_Tracker", acViewReport, "", "", acNormal
Reports!Report_ENG_MCU_Tracker.txtSecondDate = Date - 1 + #2:00:00 AM#
Reports!Report_ENG_MCU_Tracker.Report.Requery
CloseTrackerButton Me
btnYesterday_Click_Exit:
Exit Sub
btnYesterday_Click_Err:
MsgBox Error$
Resume btnYesterday_Click_Exit
End Sub
this inserts the date and time into a field on the report called txtSecondDate
there is a field on the report called txtFirstDate with a default value of Date()-1 + #02:00:00#
in the query i have two fields called MCUDate and MCUTime, i have concatenated these two fields together like this
Code:
DateTime:[MCUDate] + [MCUTime]
then in the criteria of this field i have
Code:
Between [Reports]![Report_ENG_MCU_Tracker]![txtFirstDate] And [Reports]![Report_ENG_MCU_Tracker]![txtSecondDate]
but it doesnt filter the data
when i remove the time, it works fine, but i need to filter by time aswell.
does anyone have anysuggestions?