The following code from PHV a few years ago is great for making a new directory when more than one sub folder may need to be created.
However, the code window pops up (when no break point was set in the code) with the red line highlighted in yellow (like it would if a break point had been set by a developer).
I used his code as a function in a module and the function is called from the following:
This only happens the first time the new directory is created and a user would have no idea how to proceed! Any insight as to why this happens would be greatly appreciated.
Code:
Sub myMkDir(strFolderName As String)
On Error Resume Next
Dim a, t As String, i As Integer
[b][COLOR=red]a = Split(strFolderName, "\")[/color][/b]
t = a(0)
For i = 1 To UBound(a)
t = t & "\" & a(i)
MkDir t
Next
End Sub
However, the code window pops up (when no break point was set in the code) with the red line highlighted in yellow (like it would if a break point had been set by a developer).
I used his code as a function in a module and the function is called from the following:
Code:
myPath = Application.CurrentProject.Path & "\" & CurrYear & "\" & "Qtr" & CurrQtr
If Len(Dir(myPath, vbDirectory)) = 0 Then
myMkDir (myPath)
End If
This only happens the first time the new directory is created and a user would have no idea how to proceed! Any insight as to why this happens would be greatly appreciated.