G
Guest
I am using the following code to make a new folder from a form. But now the
"MkDir strNewFolder" is returning an error. It was working previously:
Private Sub Folder_Click()
'----- start of example code -----
Const conBaseFolder As String = "O:\EWGPP\NA-233 Task Order & Invoice
Tracking\Invoice "
' this would be the folder you want to create new folders in.
Dim strNewFolder As String
strNewFolder = _
conBaseFolder & _
Me![Invoice Number]
If Len(Dir(strNewFolder, vbDirectory)) > 0 Then
MsgBox "The folder '" & strNewFolder & "' already exists!"
Else
MkDir strNewFolder
End If
Me.Folder_text_box = "O:\EWGPP\NA-233 Task Order & Invoice Tracking\" &
"Invoice" & " " & [Invoice Number]
Application.FollowHyperlink "O:\EWGPP\NA-233 Task Order & Invoice Tracking\"
& "Invoice" & " " & [Invoice Number], True
End Sub
"MkDir strNewFolder" is returning an error. It was working previously:
Private Sub Folder_Click()
'----- start of example code -----
Const conBaseFolder As String = "O:\EWGPP\NA-233 Task Order & Invoice
Tracking\Invoice "
' this would be the folder you want to create new folders in.
Dim strNewFolder As String
strNewFolder = _
conBaseFolder & _
Me![Invoice Number]
If Len(Dir(strNewFolder, vbDirectory)) > 0 Then
MsgBox "The folder '" & strNewFolder & "' already exists!"
Else
MkDir strNewFolder
End If
Me.Folder_text_box = "O:\EWGPP\NA-233 Task Order & Invoice Tracking\" &
"Invoice" & " " & [Invoice Number]
Application.FollowHyperlink "O:\EWGPP\NA-233 Task Order & Invoice Tracking\"
& "Invoice" & " " & [Invoice Number], True
End Sub