Multiple copies of Report

E

eschloss

Access 2003 / WinXP

Please enlighten me...
I have a button on a form that prints out a report. What I would like to do
is print out multiple copies of this report without generating the report
multiple times. I would also prefer to not see the report onscreen.

I have used the following code behind the button, but they each do at least
one of the above. Me!Print_Text is simply a text box that contains the
number of copies I want.

DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut , , , , Me!Print_Text

AND

DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut , , , , Me!Print_Text
 
F

fredg

Access 2003 / WinXP

Please enlighten me...
I have a button on a form that prints out a report. What I would like to do
is print out multiple copies of this report without generating the report
multiple times. I would also prefer to not see the report onscreen.

I have used the following code behind the button, but they each do at least
one of the above. Me!Print_Text is simply a text box that contains the
number of copies I want.

DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut , , , , Me!Print_Text

AND

DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut , , , , Me!Print_Text

This works for me.

Dim stDocName as String
stDocName = "MyReportName"
DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut , , , , Me!Print_Text

The Report should NOT be open in preview before using this code.
Are you sure your's is not already open? If it is already open, change
True to False in the SelectObject argument.
 
M

Mike Painter

eschloss said:
Access 2003 / WinXP

Please enlighten me...
I have a button on a form that prints out a report. What I would
like to do is print out multiple copies of this report without
generating the report multiple times. I would also prefer to not see
the report onscreen.

I have used the following code behind the button, but they each do at
least one of the above. Me!Print_Text is simply a text box that
contains the number of copies I want.
Dim i as integer
For i = 1 to Me!Print_Text
DoCmd.OpenReport stDocName, acNormal
Next i
 
E

eschloss

Fred and Mike, all these examples work. However, they generate the report
each time it prints. In other words, my report takes about 30 seconds to
generate. When I print out 5 copies of it, the total process takes 5 times
as long. Is there a way to make the report generate only once, no matter how
many copies I print out?

Thanks guys.
 
M

Mike Painter

It sounds like a time to buy one of Getz and Litwinn's books.
You can control a lot of most printers and I suspect he number of copies
your laser puts out can be set.
I doubt you can do it in Access unless you can defeat teh dynamic ability of
the report to be built on what is current.
30 seconds is a long time, is this based on a *VERY* complex query?
Are you sure the delay is in Access?
How long before a preview comes up?
 
E

eschloss

I have "Access Developers Handbook 2000". I'll try the route of controlling
the printer instead.

The code behind the report creates multiple dynamic arrays, recordsets and
uses multiple complex queries. The report is really a bar graph. Just
pulling lots of different information. Also I'm sure the code can more
efficient.

It takes around 30 seconds for the preview to come up also. Thanks for the
advice Mike.
 

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