B
Blakey300
Hi
i have the following code, which creates a folder for each record:-
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 is an error in the following line:
CreateFolder rs![EventID] & " " & rs!Format([EventStartDate], "yyyy mm dd")
I think it should be obvious what i am trying to acheive but i am not very
good at code so i was wondering if someone can recommend how to sort this.
Regards
Dave
i have the following code, which creates a folder for each record:-
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 is an error in the following line:
CreateFolder rs![EventID] & " " & rs!Format([EventStartDate], "yyyy mm dd")
I think it should be obvious what i am trying to acheive but i am not very
good at code so i was wondering if someone can recommend how to sort this.
Regards
Dave