Just make a public sub that opens a logfile and appends any string you want to it.
ex:
(if userid is a global variable)
Private Sub WriteLog(strEvent as String)
Open "c:\test.txt" For Append As #1
Print #1, cstr(userid) & format(date(), _
"m/d/yyyy" & "test"
Close #1
End Sub
Opening and closing any file on each event occurance in a program will bog down mst any / all programms. I have done this, with a few programs and decided that the app should open the log file ONCE (at the start) and close it when the app is closed. As a MINOR comment on most of the above, you should not generally use a specific file handle to open/close files, but obtain the handle through "freeFile".
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.