Bob Collison
asked on
Access 2010 Export Report As PDF With Custom Filenemae
Hi Experts,
When I Preview a report in MS Access 2010 and want to save it as a PDF the File Name defaults to the Report Name. e.g. Report 1
Is there a way to change the File Name to something Custom? e.g. Report 1 - 2019-01-30.
Thanks,
Bob C.
When I Preview a report in MS Access 2010 and want to save it as a PDF the File Name defaults to the Report Name. e.g. Report 1
Is there a way to change the File Name to something Custom? e.g. Report 1 - 2019-01-30.
Thanks,
Bob C.
I'm assuming in VBA, change the caption of the report before printing/saving.
ASKER
Hi Daniel,
Yes using VBA in Access.
I'm not sure of the 'Caption' part but it would be the File Name in the Export Window.
Thanks,
Bob C.
Yes using VBA in Access.
I'm not sure of the 'Caption' part but it would be the File Name in the Export Window.
Thanks,
Bob C.
Sorry, even easier
Dim sPDFPath As String
Dim sPDFName As String
sPDFPath = "C:\Temp\"
sPDFName = "Temp_xxxxxx.pdf"
DoCmd.OutputTo acOutputReport, "tbl_ClickTracking", acFormatPDF, sPDFPath & sPDFName
ASKER
Hi Daniel,
This looks good but I'm not sure where to put the code.
All of my reports display as Preview Report using code like the following. The user then has the option of selecting the Export as a PDF from the Ribbon. It's at this point that I would invoke this code but I don't know how.
'Step 892-Display Report.
Dim stDocName_Rnnnnn As String
stDocName_Rnnnnn = "R-nn-nnn - Report Name."
DoCmd.OpenReport stDocName_Rnnnnn, acPreview
Thanks,
Bob C.
This looks good but I'm not sure where to put the code.
All of my reports display as Preview Report using code like the following. The user then has the option of selecting the Export as a PDF from the Ribbon. It's at this point that I would invoke this code but I don't know how.
'Step 892-Display Report.
Dim stDocName_Rnnnnn As String
stDocName_Rnnnnn = "R-nn-nnn - Report Name."
DoCmd.OpenReport stDocName_Rnnnnn, acPreview
Thanks,
Bob C.
ASKER
Hi Daniel / Experts,
Any more suggestions / answers to the above?
Thanks,
Bob C.
Any more suggestions / answers to the above?
Thanks,
Bob C.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.