i have written some VBA to save a report as PDF, its pretty basic but gets the Job done,
Issue i am having is naming the PDF a unique Value, Ideally i would like to name is with the delivery warehouse, Vendor name & PO Name from the "report2" fields but i am stuck on how to get this to work, i can only manage a basic string
any help would be great as i am self taught and completely new to this, Normally google saves but i dont know if i am just snow blind but i cant find an answer
thanks
Code:
Private Sub SavePDFbttn_Click()
Dim MyPath As String
Dim MyFilename As String
MyPath = "C:\Data\RFP PO\"
MyFilename = "RFPPO" + ".pdf"
DoCmd.OpenQuery "qry_full_po_details_by_PO"
DoCmd.OpenReport "Report2", acViewPreview
DoCmd.OutputTo acOutputReport, report2, acFormatPDF, MyPath & MyFilename, True
DoCmd.Close acReport, "Report2"
DoCmd.Close acQuery, "qry_full_po_details_by_PO"
End Sub
Issue i am having is naming the PDF a unique Value, Ideally i would like to name is with the delivery warehouse, Vendor name & PO Name from the "report2" fields but i am stuck on how to get this to work, i can only manage a basic string
any help would be great as i am self taught and completely new to this, Normally google saves but i dont know if i am just snow blind but i cant find an answer
thanks