Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a invoice number on a report filename

Status
Not open for further replies.

integritycare

Technical User
Mar 12, 2011
151
AU
Hello,
As this is my first post,I was not sure where to put it. I was not able to find a section just for reports.

In this company database an invoice report is sent to a PDF writer (Foxit)so it can be emailed. The Caption on the report is labelled [blue]"Current Invoice"[/blue]

When an invoice is sent to the PDF writer the user is able to before saving it to be emailed add the invoice number. So the user would see on the "Print to Document dialog box", this Filename: [blue]Current Invoice:........ .pdf [/blue]
The user would then add the invoice number.

My question is this, Would it be possible to have the report name include the invoice number appropriate to that invoice?


The code on the print button on the invoice form is:
Private Sub PrintReport_Click()

Dim strDocName As String
Dim strWhere As String
strDocName = "Report-Inv"
strWhere = "[Invoices]=" & Me!Invoices
DoCmd.OpenReport strDocName, acPreview, , strWhere



Exit_Printreport_Click:
Exit Sub

Err_Printreport_Click:
MsgBox Err.Description
Resume Exit_Printreport_Click
End Sub


Or is there a better way to convert an invoice report to PDF with the invoice number attached without the user having to input the invoice number?

What I have been asked to do is to put a command button on the invoice form which would produce a pdf invoice report with the invoice number allready attached
The reason for this is to speed up the time it takes to generate an invoice.

Thank you
Integ

 
What I have done in the past which may be similar for PDF...

Export the a file to a specific name in a format, I was using Snapshot. If Export to PDF is supported in your version, you should be able to programmatically specify the name of the file. Alternately, you could use the Name statement to rename a file exported to a specific name.... Then attach and send the invoice programattically.... Printing to PDF and e-mailing are topics that are addressed ad nauseum in the various Access forums here.
 
Hi lameid,
Many thanks for your reply. Could you point me in the right directon for information on using the Name statement?

I am just not sure on how to go about this.

Thanks
Integ
 
Straight from the VBA help:
Name oldpathname As newpathname

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top