Hello,
I figured out how to create a new folder through the MkDir function, but my problem is, I then need my report to go to the new folder I just created.
For example:
the path is = "\\VAIO\Users\Documents\Township\" & Me.[Owner Name].Value
when I try to send the report there.. it only goes to "\\VAIO\Users\Documents\Township\" and not the new folder created titled with the owner name... the Me.[Owner Name].Value ends up getting set as the name of my report, in addition to the report name which is defined as the number.
My actual code is listed below:
Private Sub cmdFileReceipt_Click()
Dim strMyPath As String
If Me.cboMun.Value = "C-Town" Then
strMyPath = "\\VAIO\Users\Documents\C-Town\" & Me.[Owner Name].Value
End If
If Me.cboMun.Value = "O-Town" Then
strMyPath = "\\VAIO\Users\Documents\O-Town\" & Me.[Owner Name].Value
End If
If Len(Dir(strMyPath, vbDirectory)) = 0 Then
MkDir strMyPath
End If
Dim strMyName As String
strMyName = "Receipt" & Me.txtNumber.Value
DoCmd.OpenReport "File Current Permit", acViewPreview, , "[ID] = " & Me.[ID]
DoCmd.OutputTo acOutputReport, "File Current Permit", acFormatPDF, strMyPath + strMyName, False
DoCmd.Close acReport, "File Current Permit"
End Sub
Thank you for all your help!!!
A. Lyon