Collating two different reports for printing

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Yes tried that.
Still printsout requested number of report 1 togeather and then report 2
togeather.
 
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
 
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
 
Back
Top