I have a logic issue. I need to have a code that I run through a list of files, and rename them to the specified folder. Only problem is, if the folder exists I prompt a box asking if the would like to change the folder date. This happens with EVERY file if it belongs in the same folder. (May have up to 10 files going in the same folder.) Is their anyways to do this? I have posted some of my work in progress below.
Code:
Dim db As DAO.Database
Set db = CurrentDb()
Set rs = db.OpenRecordset("Conv Info Files", dbOpenDynaset)
DoCmd.SetWarnings False
If rs![CountOfFName] > 1 And rs![Date Format] = "MMDDYY" Then
If Len(Dir(strDest & BClient & "\" & rs![Placement] & "\" & strDate, vbDirectory)) <> 0 Then
strBox = InputBox("Folder Date already exists and may contain duplicate files! Would you like to make a new folder?" & vbNewLine & vbNewLine & " Selecting cancel will overwrite any existing files!", "Rename File", strDest & BClient & "\" & rs![Placement] & "\" & strDate)
If strBox <> vbCancel Then
MkDir (strBox)
Name strsourcefolder As strBox
End If
End If
If Len(Dir(strDest & BClient & "\" & rs![Placement] & "\" & strDate & "\", vbDirectory)) = 0 And PClient = CNumber Then
MkDir (strDest & BClient & "\" & rs![Placement] & "\" & strDate)
Name strsourcefolder As strDest & BClient & "\" & rs![Placement] & "\" & strDate & "\" & rs![FName]
End If
End If
rs.MoveNext
Loop
rs.Close
End Sub