Reseting Filter on report

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
 
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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top