G
Guest
I set up code which creates a filter based on user selection criterion and
then runs a report. As long as the user enters some criterion, the report
works. When the user enters no criterion, but there was criterion entered on
the last run, the report uses the last run criterion. The code is listed
below. The variable, strFilter contains the filter. If it is not equal to an
empty string the report is run with the filter, otherwise it is run without
it. I tried running the report using strFilter when it was an empty string,
but it did not remove the filter from the last run. Is there a way to do
this ?
If strFilter <> "" Then
DoCmd.OpenReport Me.cboReportType, acViewPreview, , strFilter
Else
DoCmd.OpenReport Me.cboReportType, acViewPreview
End If
then runs a report. As long as the user enters some criterion, the report
works. When the user enters no criterion, but there was criterion entered on
the last run, the report uses the last run criterion. The code is listed
below. The variable, strFilter contains the filter. If it is not equal to an
empty string the report is run with the filter, otherwise it is run without
it. I tried running the report using strFilter when it was an empty string,
but it did not remove the filter from the last run. Is there a way to do
this ?
If strFilter <> "" Then
DoCmd.OpenReport Me.cboReportType, acViewPreview, , strFilter
Else
DoCmd.OpenReport Me.cboReportType, acViewPreview
End If