Attached is a database program which allows scan operator to create a bunch of sequentially numbered subfolders.
Select User Warren Nelson, Password is Welcome.
The beginning pathway exists in the table t_User_Scan_Paths, and a TempVars is set to the path for the logged on user.
While I can get the original range of folders created, if the scanner realizes they need more folders than were originally created, I would like to be able to add that range of folders, too.
The Form is f_Create_Folder_Structures
, and here is the command button named cmd_Create_Folder_Structur
e On Click Event...
Option Compare Database
Private Sub Form_Load()
Me.txt_Main_Scan_Path = TempVars!ScanPath
Private Sub cmd_Create_Folder_Structure_Click()
Dim strBaseFolder As String
Dim strFolder As String
Dim i As Integer
On Error GoTo ProcErr
strBaseFolder = TempVars!ScanPath
strBaseFolder = _
strBaseFolder & _
"\" & Format(Date, "yyyy\-mm\-dd") ' This is an example of how other levels could be added
If CheckPath(strBaseFolder) = False Then
MsgBox "The base path could not be created." & vbNewLine & _
"Be sure the path does not end with a backslash."
For i = Val(Me.[txt_Start_Folder_Number]) To Val(Me.[txt_End_Folder_Number])
strFolder = strBaseFolder & "\" & i
If FolderExists(strFolder) Then
MsgBox strFolder & " already exists."
MsgBox "Error " & Err.Number & "(" & Err.Description & ") in cmd_Create_Folder_Structure_Click"
I am very new to VBA and could really use some help !
Thank You very much !