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
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