Hi all,
i am looking to create a directory named from a field in my table and then add a report to that directory, i can create a directory but not with the name from the field and i can also export the report but not to the directory i created
heres what i have so far
Private Sub create_quote_Click()
'create quote number
Me.quote_number = DMax("[quote_number]", "quote") + 1
MsgBox "Quote Number Order Generated"
'Export pdf
If IsNull(Me!quote_number) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
MkDir "F:\test\[quote_number]"
cdir = MsgBox("Creating Quote Directory", vbOKOnly, "Create Directory")
DoCmd.OpenReport "quote", acViewPreview, , _
"quote_number = " & Me!quote_number
Save = MsgBox("Saving report to file", vbOKOnly, "Save file as")
DoCmd.OutputTo acOutputReport, "quote", "PDF Format (*.pdf)", "F:\test\" & quote_number & ".pdf", False
End Sub
p.s. im new to vba so please bare with me
many thanks
w0od0o
i am looking to create a directory named from a field in my table and then add a report to that directory, i can create a directory but not with the name from the field and i can also export the report but not to the directory i created
heres what i have so far
Private Sub create_quote_Click()
'create quote number
Me.quote_number = DMax("[quote_number]", "quote") + 1
MsgBox "Quote Number Order Generated"
'Export pdf
If IsNull(Me!quote_number) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
MkDir "F:\test\[quote_number]"
cdir = MsgBox("Creating Quote Directory", vbOKOnly, "Create Directory")
DoCmd.OpenReport "quote", acViewPreview, , _
"quote_number = " & Me!quote_number
Save = MsgBox("Saving report to file", vbOKOnly, "Save file as")
DoCmd.OutputTo acOutputReport, "quote", "PDF Format (*.pdf)", "F:\test\" & quote_number & ".pdf", False
End Sub
p.s. im new to vba so please bare with me

many thanks
w0od0o