Print report

mveijndh

Registered User.
Local time
Today, 13:21
Joined
Dec 17, 2011
Messages
113
To save and send a report I use:
DoCmd.OutputTo acOutputReport, "rptReportName", acFormatPDF, strFullCurPathFile, False

The variable strFullCurPathFile is the full path and file name where I want to have the file:
"C:\Users\...458\CES3458.pdf"
I do get an error processing the line:
Error 2059 object not found

I want to print a query for the report for a single record do I need to specify this before I can print the report with the DoCmd?
This is what generates the correct report in the code:
DoCmd.OpenReport "rptOrderDetails", acViewReport, "queOrderSum", "OrderId =" & lgOrderId, acWindowNormal

Any Ideas
 
Last edited:
To save and send a report I use:
DoCmd.OutputTo acOutputReport, "rptReportName", acFormatPDF, strFullCurPathFile, False

The variable strFullCurPathFile is the full path and file name where I want to have the file:
"C:\Users\...458\CES3458.pdf"
I do get an error processing the line:
Error 2059 object not found

I want to print a query for the report for a single record do I need to specify this before I can print the report with the DoCmd?
This is what generates the correct report in the code:
DoCmd.OpenReport "rptOrderDetails", acViewReport, "queOrderSum", "OrderId =" & lgOrderId, acWindowNormal

Any Ideas

Air code:

Code:
Dim strWhere As String
     
        strWhere = "[OrderId] = " & Me.[lgOrderId]
        DoCmd.OpenQuery "queOrderSum", acViewPreview, , strWhere
 
Thanks for the answer, but do I run the docmd.openquery before the docmd.openreport??
I want to print a single selection to a PDF!
 
Generally, open the report filtered, then run the OutputTo, then close the report.
 

Users who are viewing this thread

Back
Top Bottom