megatronixs
Registered User.
- Local time
- Today, 03:06
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I'm having problems creating a second subfolder in the main folder.
The main folder is used to keep inside the reviews of clients inside.
The code I have now, will only create a main folder if it does not exist and then a subfolder with the BIN nr, type review and date. If the client would have a diferent ones and in diferent years. So if it has first "Prototype Model", the next one could be "Prototype Review". The part of the code that checks if the main folder exist works, but how to let the code create in the main folder the second review subfolder? Please see below code I managed so far:
Any ide how to have the code test both of them?
Greetings.
I'm having problems creating a second subfolder in the main folder.
The main folder is used to keep inside the reviews of clients inside.
The code I have now, will only create a main folder if it does not exist and then a subfolder with the BIN nr, type review and date. If the client would have a diferent ones and in diferent years. So if it has first "Prototype Model", the next one could be "Prototype Review". The part of the code that checks if the main folder exist works, but how to let the code create in the main folder the second review subfolder? Please see below code I managed so far:
Code:
Private Sub btn_Create_Folder_Click() 'XXXXXXXXXX working onXXXXXXXXXXXXXX
Dim path1 As String
Dim path2 As String
path1 = "C:\Test_Folder\Medium\" & Me.BIN & "_" & RTrim(Me.LE_Name) & "\"
path2 = "C:\Test_Folder\High\" & Me.BIN & "_" & RTrim(Me.LE_Name) & "\"
Debug.Print path1
Debug.Print path2
If Me.Rating = "High" Then
If Len(Dir(path2, vbDirectory)) > 0 Then
MsgBox "Folder already exists", vbCritical
GoTo Exit1
Else
MkDir path2
MkDir path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmm yyyy") & "\"
MkDir path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmm yyyy") & "\" & "All Other Documents\"
MkDir path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmm yyyy") & "\" & "Admin\"
MkDir path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmm yyyy") & "\" & "Emails\"
MsgBox "Folder created successfully!", vbInformation
End If
End If
End Sub
Any ide how to have the code test both of them?
Greetings.