Originally Posted by
Dal Jeanis
Great! It seems to work fine however I wouldn't mind if someone had a look at it to check I have things in order (hoping it looks ok)
Code:
'check to see if the folder exists and create one if it doesn't
If Dir("C:\AccessLogs", vbDirectory) = "" Then
MkDir ("C:\AccessLogs")
Set fs = CreateObject("Scripting.FileSystemObject")
Set txFile1 = fs.CreateTextFile("c:\AccessLogs\Employee.txt", True)
txFile1.WriteLine ("Created file on " & Date)
txFile1.Close
Else
End If
'write to a text file
intFileNum = FreeFile()
Open "C:\AccessLogs\Employee.txt" For Append As #intFileNum
Write #intFileNum, "School ID " & rs!NewSchoolsID & " was sent (including confirmations) on " & Date
Close #intFileNum