I have a strange problem with a parameter driven report.
I have a form with 2 combo boxes (unbound) to select a report using the combo box values as a parameter. I also have a button to run the report without any parameter (to show all records).
The code used to run the report on combo box values are:-
The two commands shown above work perfectly but when I run the code to show all of the records the report shows the last query and not all records.
Code for the no paramter view is :-
If I select the show all button for the firsttime, it works fine but if I choose a combo box selection and then go back to show all button, the report appears to retain the last query parameter.
How can I reset the pervious parameters to null in order to get all of the records.
I have a form with 2 combo boxes (unbound) to select a report using the combo box values as a parameter. I also have a button to run the report without any parameter (to show all records).
The code used to run the report on combo box values are:-
Code:
DoCmd.OpenReport "BookViewReport", acViewReport, , "[" & "Location" & "]" & "=" & "'" & Location.Value & "'"
DoCmd.OpenReport "BookViewReport", acViewReport, , "[" & "Adventure" & "]" & "=" & "'" & cmbActivity.Value & "'"
The two commands shown above work perfectly but when I run the code to show all of the records the report shows the last query and not all records.
Code for the no paramter view is :-
Code:
DoCmd.OpenReport "BookViewReport", acViewReport
If I select the show all button for the firsttime, it works fine but if I choose a combo box selection and then go back to show all button, the report appears to retain the last query parameter.
How can I reset the pervious parameters to null in order to get all of the records.