K
KarenH
I have a report with a query behind it, with a field called "Export Date".
The Export Date is displayed in the form of date and time, e.g. 1/30/2007
4:15:00 PM. The report contains a hidden field on it in the Detail section
called "txtExportDate".
There is a parameter form where the user enters a beginning date
(txtBeginDate) and and beginning time (txtBeginTime), so as to filter and
display only reports where the export date is on or after that date/time
combination. My code, which follows, runs without breaking, but is returning
all the records and not filtering. What is wrong that I am not seeing?
Thanks in advance.
Private Sub cmdContinue_Click()
Dim strFilter As String
Dim dtExportDate As Date
Dim strReportName As String
strReportName = "rptAuditSupport"
dtExportDate = txtBeginDate & " " & txtBeginTime
strFilter = "WHERE txtExportDate => #" & dtExportDate & "#"
DoCmd.OpenReport strReportName, acViewPreview, strFilter
End Sub
The Export Date is displayed in the form of date and time, e.g. 1/30/2007
4:15:00 PM. The report contains a hidden field on it in the Detail section
called "txtExportDate".
There is a parameter form where the user enters a beginning date
(txtBeginDate) and and beginning time (txtBeginTime), so as to filter and
display only reports where the export date is on or after that date/time
combination. My code, which follows, runs without breaking, but is returning
all the records and not filtering. What is wrong that I am not seeing?
Thanks in advance.
Private Sub cmdContinue_Click()
Dim strFilter As String
Dim dtExportDate As Date
Dim strReportName As String
strReportName = "rptAuditSupport"
dtExportDate = txtBeginDate & " " & txtBeginTime
strFilter = "WHERE txtExportDate => #" & dtExportDate & "#"
DoCmd.OpenReport strReportName, acViewPreview, strFilter
End Sub