Full Version: Refresh/requery Report
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
BobRoss
Using Access 2007

Report scenario:

- based on table
- opens from button on form
- opens by DoCmd.OpenReport
- criteria parameter for DoCmd.OpenReport supplied by form controls
- opens in print preview

Issue:

When selecting different criteria on form and opening report again after already opened, the report detail does not update accordingly.

Possible solution:

Is the recommended solution to close the report if it is already opened and then reopen it?

Possible avoidance:

Is it recommended that to avoid this issue, to open the report in report view as the criteria parameter in DoCmd.OpenReport will be applied every time the button is clicked to open the report?

Any help would be great! Thanks!
MadPiet
so check if the report is loaded already in the click event of your button. If it is, close the report and reopen it, passing the filter to the OpenReport command. then you will get a properly filtered report.
BobRoss
Thanks MadPiet! I implemented your suggestion and it works great!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.