Name and Print Report to PDF

Tophan

Registered User.
Local time
Today, 17:33
Joined
Mar 27, 2011
Messages
367
Hello,

I need help with the below code. I am trying to name and save to PDF my Invoices without having to manually name them. The problem with the code is that it is saving ALL the invoices as one document when only need the current record/invoice saved. Here is the code:

Code:
Dim FileName As String
Dim FilePath As String

FileName = Me.InvID & " - " & Me.ClientID
FilePath = "C:\Users\reva_\OneDrive\My Documents\Training\" & FileName & ".pdf"
DoCmd.OutputTo acOutputReport, "rptInvoices", acFormatPDF, FilePath
MsgBox "Invoice has been saved successfully", vbInformation, "Save confirmed"

Thanking you in advance for your help
 
Try opening the report with a filter first before saving it to pdf.
 
Try opening the report with a filter first before saving it to pdf.
Hi. I tried filtering but it still saved all the records to one PDF
 
Try opening the report with a filter first before saving it to pdf.
I misread your answer and tried filtering the form which is why it didn't work. When I filtered the report it worked. Thank you
 
I misread your answer and tried filtering the form which is why it didn't work. When I filtered the report it worked. Thank you
Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom