hi,
maybe you'll find your answer in the following function:
Private Function gf_Schrijf_Log(str_dossier As String, str_fout As String)
Dim str_sourcefilename As String
Dim str_record As String * 153
Dim rcs_a As Recordset
Dim str_logfile As String
Dim str_dos As String
Dim int_i%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fs, f, ts
On Error GoTo err_schrijf_log
str_sourcefilename = Left(CurrentDb.Name, Len(CurrentDb.Name) - 8) & "log.txt"
Set fs = CreateObject("Scripting.FileSystemObject"

file_gecreeerd:
Set f = fs.getfile(str_sourcefilename)
Set ts = f.openastextstream(ForAppending)
str_record = ""
Mid(str_record, 1, 150) = str_dossier
ts.write str_record & vbCrLf
For int_i = Len(str_dossier) To 0 Step -1
If Mid(str_dossier, int_i, 1) <> "\" Then
str_dos = Mid(str_dossier, int_i, 1) & str_dos
Else
int_i = 0
End If
Next int_i
str_record = ""
Mid(str_record, 1, 80) = str_dos
Mid(str_record, 81, 20) = CurrentUser
Mid(str_record, 102, 20) = Now()
ts.write str_record & vbCrLf
str_record = ""
ts.write str_fout & vbCrLf
ts.Close
Set ts = Nothing
Set f = Nothing
Exit Function
err_schrijf_log:
Select Case Err.Number
Case 53
Set f = fs.CreateTextFile(str_sourcefilename)
Set f = fs.getfile(str_sourcefilename)
Set ts = f.openastextstream(ForAppending)
ts.write "logfile" & vbCrLf
ts.Close
Resume file_gecreeerd
End Select
End Function