Report prints heading on second page

stanger1

Registered User.
Local time
Today, 15:47
Joined
Jul 30, 2002
Messages
53
I am printing 2 copies of the first page to letterhead and the rest of the report prints to plain paper. The report prints fine if there are multiple pages to the report, however if there is only one page, the report prints two copies to letterhead and one copy to plain paper. The copy that goes to plain paper only shows the page heading and the page number says page 2 of 1. Listed below is a sample of my coding. Any help with this would be greatly appreciated.

Type zwtDevModeStr
RGB As String * 94
End Type
Type zwtDeviceMode
dmDeviceName As String * 16
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperlength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * 16
dmPad As Long
dmBits As Long
dmPW As Long
dmDFI As Long
dmDRr As Long
End Type


Sub setPaperSource4(rptName As String)
Dim rpt As Report
Dim DM As zwtDeviceMode
Dim DevString As zwtDevModeStr
Dim DevModeExtra As String

DoCmd.SetWarnings False
' Set Paper Tray for page 1
DoCmd.OpenReport "Reprint cert report official", acViewDesign, , "Invoice_no = " & INVOICE_NO
Set rpt = Reports("[Reprint cert report official]")
DevModeExtra = rpt.PrtDevMode
DevString.RGB = DevModeExtra
LSet DM = DevString
DM.dmDefaultSource = 2 '1 = Upper Tray, 2 = Lower Tray, 5 = _Envelope Feeder
LSet DevString = DM
Mid$(DevModeExtra, 1, 68) = DevString.RGB
rpt.PrtDevMode = DevModeExtra
DoCmd.Save acReport, "Reprint cert report official"
DoCmd.SelectObject acReport, "Reprint cert report official", True
DoCmd.PrintOut acPages, 1, 1, copies, 2

' Set Paper Tray for page 2
DoCmd.OpenReport "Reprint cert report official", acViewDesign
Set rpt = Reports("[Reprint cert report official]")
DevModeExtra = rpt.PrtDevMode
DevString.RGB = DevModeExtra
LSet DM = DevString
DM.dmDefaultSource = 1 '1 = Upper Tray, 2 = Lower Tray, 5 = _Envelope Feeder
LSet DevString = DM
Mid$(DevModeExtra, 1, 68) = DevString.RGB
rpt.PrtDevMode = DevModeExtra
DoCmd.Save acReport, "Reprint cert report official"
DoCmd.SelectObject acReport, "Reprint cert report official", True
DoCmd.PrintOut acPages, 2, 20, copies, 2

End If
End Sub
 
Check you page margins. What you're seeing occurs when the margns and data (together) are bigger than one physical page.
 
Thanks for the reply! No matter how small I make the report, I still get the extra page. If I do not use the module, the report prints fine. There must be something in the module code itself that is causing problems. If you have any more comments, let me know. - Thanks again.
 
Check the width and height of the report, I still think that it is larger than the physical page.
 
Thanks for your help! I will look into that further.
 

Users who are viewing this thread

Back
Top Bottom