View Full Version : Print more than 1 copy


SteveE
08-20-2003, 11:29 AM
Is there an option to select how many prints will be printed from theaccess options I would like be to print 2 or 3 etc copies, I can do this through the print dialouge but can I select this option anywhere in the access options?


Steve

evilman
08-20-2003, 11:37 AM
use the PrintOut method
first open the report in preview mode
call the printout method
and then close it

DoCmd.OpenReport "My Report", acViewPreview, , , acWindowNormal
DoCmd.PrintOut acPrintAll, , , , NumberOfCopies
DoCmd.Close acReport, "My Report"

replace NumberOfCopies with some variable or some constant that represents the number of copies.

SteveE
08-21-2003, 01:06 AM
Thanks, I have amended the sample as below but where do I use this? you'll have to excuse me as I can work around the basic OK but I not sure just where to put this.

DoCmd.OpenReport "Planning Report", acViewPreview, , , acWindowNormal
DoCmd.PrintOut acPrintAll, , , , 2
DoCmd.Close acReport, "Planning Report"

thanks again

steve

SforSoftware
08-21-2003, 01:41 AM
Steve,

You can use this code ie in the Click-event of a commandbutton on your form

SteveE
08-21-2003, 02:08 AM
Thanks but when I use this I am getting an error "wrong number of arguments or invalid property assiognments"

any ideas?

Stev

SteveE
08-21-2003, 02:09 AM
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "PlanningReport"
DoCmd.OpenReport "Planning Report", acViewPreview, , , acWindowNormal
DoCmd.PrintOut acPrintAll, , , , 2

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click

End Sub

SforSoftware
08-21-2003, 03:03 AM
Try this:Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String

DoCmd.OpenReport "Planning Report"
DoCmd.PrintOut acPrintAll, , , , 2
DoCmd.Close acReport, "Planning Report", acSaveNo

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub

SteveE
08-21-2003, 03:12 AM
Sorry to be a pain and thanks for the help, but the program now prints 1 copy of the selected report page and two copies of the form where the commond button is located.

Steve

SforSoftware
08-21-2003, 03:59 AM
Sorry 's mine :o
after "DoCmd.OpenReport "Planning Report" " add: , acViewPreview

SteveE
08-21-2003, 04:02 AM
Great,

thanks a million

Steve

SteveE
08-26-2003, 08:52 AM
This now works great and I ask only one more question, when the notes printout can I insert a command so as the indivisual notes are colleated together, I can do this with printer controls but can it be built into the print options??

thanks

Steve

SforSoftware
08-26-2003, 09:42 AM
Steve,

When you look in Help for PrintOut, you'll find de specification of this function. I don't think you did this, because you then didn't ask this question..

But Ok, add one argument to the DoCmd.Printout:
DoCmd.PrintOut acPrintAll, , , , 2, True

Set the last argument to True for sorting the prints.

SteveE
08-26-2003, 10:13 AM
Ok I tried using the help and whilst I found the section I still cannot get the printouts to come out as non-colleated (False) below is the section of code which should print 2 copies of each together and then the next page.

DoCmd.OpenReport "PlanningReport", acViewPreview
DoCmd.PrintOut acPrintAll, , , , 2, 0
DoCmd.Close acReport, "PlanningReport", acSaveNo

Any help please ?

Steve

SforSoftware
08-26-2003, 10:57 AM
Hi,

I should think it must be True instead of False?

DoCmd.OpenReport "PlanningReport", acViewPreview
DoCmd.PrintOut acPrintAll, , , , 2, True
DoCmd.Close acReport, "PlanningReport", acSaveNo

The last argument is the same as you use in the build-in print-dialogbox.

SteveE
08-26-2003, 11:13 AM
Thanks but I tried True, False, 0, -1 , 1 but it just seems to make no difference.

Steve

SforSoftware
08-26-2003, 11:46 AM
Then I'm sorry. :confused: Maybe someone else?

SteveE
08-27-2003, 12:56 AM
Well thanks anyway

regards

Steve

indesisiv
08-28-2003, 05:33 AM
i seem to recall that it is Yes or No to collate copies. Default is YES

Steve

indesisiv
08-28-2003, 05:48 AM
Sorry I have just looked at it ... it is
True (-1) and False (0)
which is what you have tried i think so no help there

Sorry about that

SteveE
08-28-2003, 06:02 AM
Thanks for all your help, I can only think the printer defaults must be overiding the code
but thanks anyway

Steve