Link to home
Start Free TrialLog in
Avatar of sheng wee
sheng wee

asked on

Pdf to save under the folder that obtain the same name from Pdf

Hello everyone,

I am having one button to create folder behind the Access
Private Sub Command58_Click()

filename = Ref_Number.Value
MkDir "c:\AccessDatabase\" & filename
MkDir "c:\AccessDatabase\" & filename & "\Commercial"
MkDir "c:\AccessDatabase\" & filename & "\Deployment"
MsgBox ("File has been created successfully")

Now I want a button that can save the Pdf into the folder itself based on the same Ref_Number

Dim filename As String
Dim filepath As String

filename = Me.Ref_Number
filepath = "c:\AccessDatabase\" & filename & ".pdf"
DoCmd.OutputTo acOutputReport, "OrderCustomerReport", acFormatPDF, filepath
MsgBox "Quotation has been saved successfully", vbInformation, "Save confirmed"

What code am I missing out? or What code to input?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sheng wee
sheng wee

ASKER

Thank you ! How blind of me to forget that one part !