Private Sub btn_Create_Folder_Click()
Dim path1 As String
Dim path2 As String
Dim myError As String
Dim TempPath1 As String
Dim TempPath2 As String
Dim TempPath3 As String
Dim TempPath4 As String
Dim TempPath5 As String
path1 = "C:\Test_Folder\Medium\" & Me.BIN & "_" & RTrim(Me.LE_Name) & "\"
path2 = "C:\Test_Folder\High\" & Me.BIN & "_" & RTrim(Me.LE_Name) & "\"
If Me.Rating = "Medium" Then
TempPath1 = path1
TempPath2 = path1 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\"
TempPath3 = path1 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "All Other Documents\"
TempPath4 = path1 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "Admin\"
TempPath5 = path1 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "Emails\"
If Len(Dir(TempPath1, vbDirectory)) > 0 Then
If Len(Dir(TempPath2, vbDirectory)) > 0 Then
MsgBox "Unable to create (all) folders: "
Else
MkDir TempPath2
MkDir TempPath3
MkDir TempPath4
MkDir TempPath5
MsgBox "Folder created successfully!", vbInformation
End If
Else
MkDir TempPath1
MkDir TempPath2
MkDir TempPath3
MkDir TempPath4
MkDir TempPath5
MsgBox "Folder created successfully!", vbInformation
End If
End If
If Me.Rating = "High" Then
TempPath1 = path2
TempPath2 = path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\"
TempPath3 = path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "All Other Documents\"
TempPath4 = path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "Admin\"
TempPath5 = path2 & Me.BIN & "_" & test(Me.Type_Review) & "_" & Format(Me.START_date, "mmmm yyyy") & "\" & "Emails\"
If Len(Dir(TempPath1, vbDirectory)) > 0 Then
If Len(Dir(TempPath2, vbDirectory)) > 0 Then
MsgBox "Unable to create (all) folders: "
Else
MkDir TempPath2
MkDir TempPath3
MkDir TempPath4
MkDir TempPath5
MsgBox "Folder created successfully!", vbInformation
End If
Else
MkDir TempPath1
MkDir TempPath2
MkDir TempPath3
MkDir TempPath4
MkDir TempPath5
MsgBox "Folder created successfully!", vbInformation
End If
End If