Error printing a report (1 Viewer)

Yuly17

New member
Local time
Today, 15:25
Joined
Nov 10, 2022
Messages
14
Hi,

I just create a new report and use the following code to print in pdf. The problem is the pdf file show me 11 pages when I just need 1. For the record the 11 pages are the same page information repeated 11 times. I have 250 records in the database

MyFileName = Me.AssemblyPartCode & "-GESNAcontrolsheet" & ".pdf"
DoCmd.OpenReport "GESNAcontrolsheet", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "GESNAcontrolsheet", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "GESNAcontrolsheet"

any suggestions? the program print other files at the same time without this issue.
 

plog

Banishment Pending
Local time
Today, 09:25
Joined
May 11, 2011
Messages
11,646
When you manually open the report inside access do you see the 11 pages? Or does this only occur when you export to pdf?
 

Yuly17

New member
Local time
Today, 15:25
Joined
Nov 10, 2022
Messages
14
When you manually open the report inside access do you see the 11 pages? Or does this only occur when you export to pdf?
only see 1 page in the report preview
 

Yuly17

New member
Local time
Today, 15:25
Joined
Nov 10, 2022
Messages
14
and if I change acPreview to acNormal, then it prints the 250 records on the same pdf file
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:25
Joined
May 7, 2009
Messages
19,245
only see 1 page in the report preview
how about on "Print Preview", do you see only 1 page and the navigation button is disabled?
 

Yuly17

New member
Local time
Today, 15:25
Joined
Nov 10, 2022
Messages
14
Yes, but was quite long. I did change the margins and it works. Thanks
 

Users who are viewing this thread

Top Bottom