Reseting Filter on report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I set up a report generator which allows the user to select some parameters
and then filter the report by them. When the user selects the filter, it
works correctly, however, it does not seem to be removing the filter if the
user decides to get all the records. How could this be accomplished ?
Currently I use this code to filter the search:

strFilter = strFilter & " And [BRNum] = " & CInt(Me.cboBr)
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter

To remove the filter I used:

strFilter = ""
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter
 
I set up a report generator which allows the user to select some parameters
and then filter the report by them. When the user selects the filter, it
works correctly, however, it does not seem to be removing the filter if the
user decides to get all the records. How could this be accomplished ?
Currently I use this code to filter the search:

strFilter = strFilter & " And [BRNum] = " & CInt(Me.cboBr)
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter

To remove the filter I used:

strFilter = ""
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter

To show all the records in the report's record source, simply use:
DoCmd.OpenReport "EmployeeReport", acViewPreview
 
Thank you

fredg said:
I set up a report generator which allows the user to select some parameters
and then filter the report by them. When the user selects the filter, it
works correctly, however, it does not seem to be removing the filter if the
user decides to get all the records. How could this be accomplished ?
Currently I use this code to filter the search:

strFilter = strFilter & " And [BRNum] = " & CInt(Me.cboBr)
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter

To remove the filter I used:

strFilter = ""
DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter

To show all the records in the report's record source, simply use:
DoCmd.OpenReport "EmployeeReport", acViewPreview
 
Back
Top