MkDir

Sigma248

Registered User.
Local time
Today, 03:26
Joined
Oct 6, 2008
Messages
24
I am trying to use the MkDir function to make a new subfolder of an existing folder path:

Public Sub Create_Folder(Job_Name As String)

Dim Folder_Path as String

Folder_Path = "C:\Dean\Documents\Work\" & Job_Name

MkDir (Folder_Path)

end Sub

where "C:\Dean\Documents\Work" is an existing folder structure.

When the Sub is called I get:

Run-time error '76':

Path not found.

What am I doing wrong?
 
put msgbox(folder_path) before the mkdir command to see exactly what it is trying to do
 
I would replace your & with +.
I have the code doing almost the same thing and I had to use +
I am using Access 2003
 
I took out your _'s and put my own folder in there and it works like a charm. I also made it a function instead of a sub.

Code:
Public Function CreateFolder(JobName As String) 
Dim FolderPath As String

FolderPath = "C:\Testit\" & JobName

MkDir (FolderPath)

End Function
 

Users who are viewing this thread

Back
Top Bottom