Sorry, but "Path" is a valid Access property, otherwise called a "reserved
word." You cannot use reserved words as variable names. Change all instances
of the standalone word "Path" and try your program again.
Sam
>For instances where my FolderPath value is "C:\MyQuotation\Jan" it won't
>create the directory. Is there something I can do to correct the code?
[quoted text clipped - 18 lines]
> strLinkPath = Path
> End If

Signature
Sam
pubdude2003 - 22 Dec 2006 15:26 GMT
Thanks Dev, didn't know that, although the code did work for single dir
creation.
At any rate here is the code for multiple dir
Dim strPath As String
Dim aFolders() As String
Dim I As Integer
If Not IsNull(DLookup("FolderPath", "UserPass")) Then
strPath = (DLookup("FolderPath", "UserPass"))
End If
If Dir(strPath, vbDirectory) = "" Then
If Len(strPath) = 0 Then
Err.Raise 5
Exit Sub
End If
aFolders = Split(strPath, "\")
strPath = vbNullString
For I = LBound(aFolders) To UBound(aFolders)
strPath = strPath & aFolders(I)
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = strPath & "\"
Next I
End If
pubdude2003 - 22 Dec 2006 15:26 GMT
Thanks Dev, didn't know that, although the code did work for single dir
creation.
At any rate here is the code for multiple dir
Dim strPath As String
Dim aFolders() As String
Dim I As Integer
If Not IsNull(DLookup("FolderPath", "UserPass")) Then
strPath = (DLookup("FolderPath", "UserPass"))
End If
If Dir(strPath, vbDirectory) = "" Then
If Len(strPath) = 0 Then
Err.Raise 5
Exit Sub
End If
aFolders = Split(strPath, "\")
strPath = vbNullString
For I = LBound(aFolders) To UBound(aFolders)
strPath = strPath & aFolders(I)
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = strPath & "\"
Next I
End If