Creating Folders

B

Blakey300

Hi

I have the following code that creates a folder for each record in the
database:

Option Compare Database
Option Explicit

Function CreateGradingFolder()

Dim rs As DAO.Recordset

Set rs = Forms![Grading Events (Edit)].RecordsetClone
If Not rs.BOF And Not rs.EOF Then
Do While Not rs.EOF
CreateFolder rs![EventID] & " " & rs!Format([EventStartDate], "yyyy
mm dd")
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing



End Function

Private Sub CreateFolder(ASubFolder As String)

Dim strDesktop As String
Dim strSubfolder As String

strDesktop = "C:\Keibudo Karate Schools\Documents\Event Documents\Grading\"

If Len(Dir(strDesktop & ASubFolder, vbDirectory)) = 0 Then
MkDir strDesktop & ASubFolder
End If

End Sub

I know the following line is wrong, and i have put it in there to give an
idea of what i am trying to acheive.

CreateFolder rs![EventID] & " " & rs!Format([EventStartDate], "yyyy mm
dd")


Regards

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top