I have a database set up, it works perfectly in every way I need it to except for the fact that when I enter in my coding for it to create directories (folders) on our network drive it will only work partially.
My coding is as such:
Private Sub Combo97_AfterUpdate()
strPath = "X:\AAA\BBB\CCC" & "\" & Me.County
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = "X:\AAA\BBB\CCC" & "\" & Me.County & "\" & Me.City
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = "X:\AAA\BBB\CCC" & "\" & Me.County & "\" & Me.City & "\" & Me.HouseNumber & IIf(IsNull(Me.StreetDirection), "", " " & Me.StreetDirection) & " " & Me.StreetName & IIf(IsNull(Me.StreetType), "", " " & Me.StreetType)
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
Shell "explorer.exe " & strPath, vbNormalFocus
End Sub
What it does (which I'm sure advanced users know) is that it will take the data from my fields and create a file structure out on our network drive so we can scan the documents associated with the projects into those folders for an "online library" of applications, pictures, etc. My problem is when I only have the first two strPath's it will create the County and City folders fine...but then I add the other fields to it and it gives me a method and data member not found (see right). I am just wondering if anyone would be able to help me out on this one as I have no idea why it is working for one line and then not working the next.
Thank you for any help.