Option Compare Database
Private Sub MakeAFolder_Click()
Dim strDirectoryPath1 As String
Dim strDirectoryPath2 As String
Dim strDirectoryPath3 As String
Dim strDirectoryPath4 As String
strDirectoryPath1 = "C:\working\A\" + CStr(Me.UPC)
strDirectoryPath2 = "C:\working\B\" + CStr(Me.UPC)
strDirectoryPath3 = "C:\working\C\" + CStr(Me.UPC)
strDirectoryPath4 = "C:\working\D\" + CStr(Me.UPC)
If IsNull(Me.type) Then
Select Case MsgBox("You must select a project type before you can create folders!" & vbCr & vbCr & _
" Click ""YES"" To Go Back And Enter The Required Information.", vbCritical + vbYes)
Case vbYes
Me.type.SetFocus
End Select
End If
Select Case Me.type
Case "A"
If Len(Dir$(strDirectoryPath1 & "\.", vbDirectory)) <> 0 Then
MsgBox "This project UPC folder already exists, please Explore the drive for the folder that matches C:\working\A\" + CStr(Me.UPC)
Else
MkDir (strDirectoryPath1)
MsgBox "A folder has been created on the network at location C:\working\A\" + CStr(Me.UPC)
End If
Case "B"
If Len(Dir$(strDirectoryPath2 & "\.", vbDirectory)) <> 0 Then
MsgBox "This project UPC folder already exists, please Explore the drive for the folder that matches C:\working\B\" + CStr(Me.UPC)
Else
MkDir (strDirectoryPath2)
MsgBox "A folder has been created on the network at location C:\working\B\" + CStr(Me.UPC)
End If
Case "C"
If Len(Dir$(strDirectoryPath3 & "\.", vbDirectory)) <> 0 Then
MsgBox "This project UPC folder already exists, please Explore the drive for the folder that matches C:\working\C\" + CStr(Me.UPC)
Else
MkDir (strDirectoryPath3)
MsgBox "A folder has been created on the network at location C:\working\C\" + CStr(Me.UPC)
End If
Case "D"
If Len(Dir$(strDirectoryPath4 & "\.", vbDirectory)) <> 0 Then
MsgBox "This project UPC folder already exists, please Explore the drive for the folder that matches C:\working\D\" + CStr(Me.UPC)
Else
MkDir (strDirectoryPath4)
MsgBox "A folder has been created on the network at location C:\working\D\" + CStr(Me.UPC)
End If
End Select
End Sub