• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 44
  • Last Modified:

Wondering why, when a report is displayed in Print Preview mode and I hit ‘print’, it runs another query and takes some time to actually send to the printer

I'm wondering why, when a report is displayed in Print Preview mode and I hit ‘print’, it runs another query and takes some time to actually send to the printer.  Is there a way to avoid this?
0
SteveL13
Asked:
SteveL13
  • 2
3 Solutions
 
JohnBusiness Consultant (Owner)Commented:
Preview is just that - so you can see the layout and number of pages to be printed.  Print is another and separate process, so it may process the data again, depending on the software. I have seen this and it varies for me.
0
 
mbizupCommented:
<<why, when a report is displayed in Print Preview mode and I hit ‘print’, it runs another query >>

From an MS Access perspective, I believe what is happening is that the query runs once when you use the following command: Docmd.openReport "YourReport", acViewPreview.  

The Print button then effectively runs the OpenReport command again in "Normal View" (hardcopy), thereby running the query a second time.

<<Is there a way to avoid this? >>

Try opening the report in REPORT VIEW instead of Print Preview:

Docmd.openReport "YourReport", acViewReport

Open in new window


Report View, unlike Print Preview can run code from command buttons placed on the report.  

Add a command button to the header section of the report with the following code to do the printout:

On Error Resume Next
Docmd.RunCommand acCmdPrint

Open in new window


This will print the currently loaded report without re-running the query.  (Opening the report using acViewReport at this point has already done the 'heavy lifting').
0
 
mbizupCommented:
Steve,

FYI, my comment above assumes you are running Access 2007 or later and that your database is in .accdb format.  Report View was not an option in earlier versions of Access.
0
 
PatHartmanCommented:
There is no way around this.  Access reruns the query to ensure the printed data is as fresh as possible.  To avoid this issue, I give my users an option group on the form that prints reports so if they don't need to preview the report, it can go straight to the printer.  If the open in print preview and then want to print, Access reruns the query and that's that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now