I have very limited knowledge of vba. I amtrying to check and see if a sub-folder exists on my c drive and if it does not then create one using the variable name FileNo.
The first time I run the procedure it creates the file as it should. However, if I click the button again I get this error message. run time error 75 "path\file access error.
Her is the code I am using. What am I doing wrong?
Thanks in advance
Private Sub CmdMakeDir_Click()
Dim test As Integer
test = Len(Dir("C:\Client Data" & "\" & Me.[FileNo]))
If test = 0 Then
'' directory doesn't exist
MkDir "C:\Client Data" & "\" & Me.[FileNo]
End If
End Sub
The first time I run the procedure it creates the file as it should. However, if I click the button again I get this error message. run time error 75 "path\file access error.
Her is the code I am using. What am I doing wrong?
Thanks in advance
Private Sub CmdMakeDir_Click()
Dim test As Integer
test = Len(Dir("C:\Client Data" & "\" & Me.[FileNo]))
If test = 0 Then
'' directory doesn't exist
MkDir "C:\Client Data" & "\" & Me.[FileNo]
End If
End Sub