Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

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

Avatar of sheng wee
sheng wee asked on
Microsoft AccessVBA
2 Comments1 Solution77 ViewsLast Modified:
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)
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers