create multiple folders_please help

blioux

Registered User.
Local time
Today, 07:39
Joined
Sep 10, 2002
Messages
14
the following code will create the first folder and then give me an error that says no current record found, i can see it's cycling though the records. why doesn't it create a folder for each record?


Private Sub Command2_Click()

Dim stAppName As String
Dim strDirectoryPath As String
Dim rs As Object

Set rs = Forms!Distinct_DJ.RecordsetClone



Recordset.MoveFirst
Do While Not rs.EOF
strDirectoryPath = "C:\Retrieve_Test\" + CStr(rs.Fields("datejoined"))
If Dir(strDirectoryPath, vbDirectory) = "" Then
MkDir strDirectoryPath
End If
Recordset.MoveNext
Loop

End Sub
 

Users who are viewing this thread

Back
Top Bottom