WhiskyLima
Registered User.
- Local time
- Today, 23:03
- Joined
- Oct 8, 2013
- Messages
- 48
Hey all, hopefully this should be an easy one for you. If have a report which I want to save as a PDF. The reports are named based on a couple of variables IE client name and invoice number; for example, 'whiskylima inv. 12345.pdf'
What I am trying to achieve is getting the save as location folder to pop up and ask where to save the file, with the filename already populated with the information.
Here is what I have
I have tried this as an alternative but I get an error:
Microsoft Access cannot find the object '|1'.
I assume this is because I have told it what the file is called now but it dosn't know which report to save as that file. I would really like to be able to have my cake and eat it here if possible and I don't want to use a fixed save location or generic filename.
Cheers guys
What I am trying to achieve is getting the save as location folder to pop up and ask where to save the file, with the filename already populated with the information.
Here is what I have
Code:
Private Sub cmdSavePDF_Click()
Dim LastName As String
Dim pdfName As String
Dim baseLocation As String
LastName = Mid([Forms]![SACreateInvoice]![txtClient], InStrRev([Forms]![SACreateInvoice]![txtClient], " ") + 1)
pdfName = LastName & " Inv " & Forms![SACreateInvoice]![txtInvoiceNumber] & ".pdf"
DoCmd.OutputTo acOutputReport, , "PDFFormat(*.pdf)", pdfName, False, "", , acExportQualityPrint
End Sub
I have tried this as an alternative but I get an error:
Microsoft Access cannot find the object '|1'.
Code:
DoCmd.OutputTo acOutputReport, pdfName, "PDFFormat(*.pdf)", pdfName, False, "", , acExportQualityPrint
I assume this is because I have told it what the file is called now but it dosn't know which report to save as that file. I would really like to be able to have my cake and eat it here if possible and I don't want to use a fixed save location or generic filename.
Cheers guys