Make New Folder code not working any more

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
 
G

Guest

Oops, sorry. Figured it out. Basically I had changed the folder address so
it was no longer working. Thanks. The code works fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top