Link to home
Start Free TrialLog in
Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland

asked on

Saving a PDF file

I have 2 bits of code whose logic I wish to combine;
The bottom line is that I want to write a PDF to my C: Drive.

Code A below generates a report correctly.  Note the sWhere filter.
Code B writes to disk but DOES not have a filter.

I guess I want to know - How do I write code B with the filter.

(Hopefully this is clear, it is late here and time for bed!)
CODE A
=======
sWhere = "[CustomerID] = " & Me.CustomerID
DoCmd.OpenReport "rptOrderDetails", acViewPreview, , sWhere

Code B
=======
DoCmd.OutputTo acReport, "rptorderdetails", acFormatPDF, "myreport" & ".pdf", False, ""

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of tabish
tabish

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patrick O'Dea

ASKER

Thanks,
I should have clarified in the first instance.
It is not really a report at at (!)  It is a single page output of ONE record.

Hence the output is more like a screen dump of customer data.
I do not need a recordset.
I just want the single record output where the customerID joins the report and the form.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks I have nearly got it...