Hi
I use the following code to save a report as a pdf to my desktop. All works fine.
At the moment it save the report: rptDevPackPage1
I want it to also include: rptDevPackPage2
but only create one saved pdf with both pages on.
In summary save two reports into one pdf file.
Is the possible. I managed to find the exisiting code online and tried to add the name of the second rpt I wanted but just get errors.
Thanks
I use the following code to save a report as a pdf to my desktop. All works fine.
At the moment it save the report: rptDevPackPage1
I want it to also include: rptDevPackPage2
but only create one saved pdf with both pages on.
In summary save two reports into one pdf file.
Is the possible. I managed to find the exisiting code online and tried to add the name of the second rpt I wanted but just get errors.
Thanks
Code:
Private Sub Command132_Click()
Dim FileName As String
Dim FilePath As String
Dim UserLogin As String
On Error GoTo My_ErrorHandler:
UserLogin = Environ("UserName")
FileName = "DevelopmentPack"
FilePath = "C:\Users\Jonathan\Desktop\" & FileName & ".pdf"
'DoCmd.OutputTo acOutputForm, "tbl_customer", acFormatPDF, FilePath
DoCmd.OutputTo acOutputReport, "rptDevPackPage1", acFormatPDF, FilePath
MsgBox "Development Pack has been successfully saved as a PDF to Desktop", vbInformation, "Save confirmed"
exit_My_ErrorHandler:
Exit Sub
My_ErrorHandler:
MsgBox "Error # :" & err.Number & ", " & err.Description, vbExclamation
Resume Next
End Sub