Collating two different reports for printing

G

Guest

On a form command button will randomise questions then popup a message box to
ask how many copies to print. then prints the number of copies of report 1
front page and report 2, 5 pages of questions but not collated. I am using
the following code

Dim numcopies As String
numcopies = InputBox("Enter number of copies")

If IsNumeric(CInt(numcopies)) = False Then
MsgBox "Not a number"
Exit Sub
End If
DoCmd.Echo False
Dim stDocName As String

stDocName = "Road Sign Paper Cover"
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut acPages, 1, 1, , CInt(numcopies)

stDocName = "Road Sign Paper"
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut acPages, 1, 5, , CInt(numcopies)

Any ideas how I can alter this to collate the copies when printing to save
having to do it manually

Thanks
 
J

John Spencer

The full set of arguments to PrintOut has a collateCopies (True/False) as
the last argument. Have you tried that?

DoCmd.PrintOut acPages, 1, 1, , CInt(numcopies), True
 
G

Guest

Yes tried that.
Still printsout requested number of report 1 togeather and then report 2
togeather.
 
J

John Spencer

I think you are going to have to loop through the two reports if you want
them collatted and I'm not sure that even that will guarantee the
collation. It depends on the printer and whether or not you are on a
network printer

Perhaps something like the following.

Dim iCount as Integer

For iCount = 1 to Cint(numCopies)
stDocName = "Road Sign Paper Cover"
DoCmd.OpenReport stDocName, acviewnormal

stDocName = "Road Sign Paper"
DoCmd.OpenReport stDocName, acviewnormal

Next iCount
 
G

Guest

Thanks John that works a treat.
--
Alan


John Spencer said:
I think you are going to have to loop through the two reports if you want
them collatted and I'm not sure that even that will guarantee the
collation. It depends on the printer and whether or not you are on a
network printer

Perhaps something like the following.

Dim iCount as Integer

For iCount = 1 to Cint(numCopies)
stDocName = "Road Sign Paper Cover"
DoCmd.OpenReport stDocName, acviewnormal

stDocName = "Road Sign Paper"
DoCmd.OpenReport stDocName, acviewnormal

Next iCount
 

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