Error printing a report

Yuly17

New member
Local time
Today, 05:33
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.
 
When you manually open the report inside access do you see the 11 pages? Or does this only occur when you export to pdf?
 
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
 
and if I change acPreview to acNormal, then it prints the 250 records on the same pdf file
 
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?
 
Yes, but was quite long. I did change the margins and it works. Thanks
 

Users who are viewing this thread

Back
Top Bottom