Solved Prevent report from refreshing (1 Viewer)

swingline

Member
Local time
Today, 15:00
Joined
Feb 18, 2020
Messages
51
Is there a way to prevent a report with a query as its data source from refreshing when going to print preview or printing?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:00
Joined
May 7, 2009
Messages
19,231
Data on report is but a snapshot of the records at the time the report is displayed/printed. It does not refresh unless you re open it.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:00
Joined
Feb 19, 2002
Messages
43,213
No. Access runs the recordsource query when you preview the report and it runs it AGAIN when you print the preview specifically to ENSURE the most current values.

What problem is caused by having up to date data in the printed report?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:00
Joined
May 7, 2009
Messages
19,231
it will only refresh if you have Code on Load Or Open event of the Report.
 

swingline

Member
Local time
Today, 15:00
Joined
Feb 18, 2020
Messages
51
No. Access runs the recordsource query when you preview the report and it runs it AGAIN when you print the preview specifically to ENSURE the most current values.

What problem is caused by having up to date data in the printed report?

In this case, I am using the query to randomly generate an exam. The report uses conditional formatting to highlight the answers, so the idea was to allow instructors to print a key if needed, then disable the highlighting to allow the exam to be printed for students. So, in this case, the query running after each print is a bit of a problem.

I just ended up creating a temp table and appending the query results to the table.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:00
Joined
Feb 19, 2002
Messages
43,213
arne, It would appear that someone fixed that little quirk.

swingline, I guess I'm not sure the problem is. If you prompt for a variable that your code uses to make hignlights and you print, do you not want the highlighting to print?
 

Users who are viewing this thread

Top Bottom