Reseting Filter on report

R

rmcompute

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
 
F

fredg

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
 
R

rmcompute

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
 
Top