|
You
need to put error trapping EVERYWHERE! Then you can at the least close the
application entirely when it gets hit. I picked up some code which I put
into a module that writes to an error log (text file) when anything unexpected
gets to my error trap routines:
Function Instrumented(Error As String)
' Comments: Write all errors to a log file ' Parameters: Error -- string sent in error trap ' -------------------------------------------------- On Error GoTo PROC_ERR Dim strLog As String Dim intFile As Integer Dim strPath As String Dim strMsg As String strLog = strPath & "DB_Error.Log" ' set up the path you want, probably on network LocalStart: intFile = FreeFile() If FileExists(strLog) Then Open strLog For Append As #intFile Else Open strLog For Output As #intFile End If Print #intFile, Now() ' to give it a timestamp Print #intFile, pstrError Close intFile PROC_EXIT: Exit Function PROC_ERR: If Err = 76 Then ' Path not found strLog = "c:\DB_Error.log" ' use if your set-up path isn't found (for work at home!) Resume LocalStart End If MsgBox Err.Description Resume PROC_EXIT End Function Then
call the function in the error trap section:
PROC_Err:
Instrumented "FormName!CodeModuleName: " &
Error(Err) ' concatenate any other useful data
You
can do a lot with that, possibly concatenate the current user's name in the
Instrumented code, add variables and values when you know where the errors are
but not why they are happening, etc.
Tobi
|
Title: Message
- RE: [AccessDevelopers] Keeping users away from the... Cathy Jupp
- RE: [AccessDevelopers] Keeping users away fro... Hoffman, Tobi K \(DYS\)
- RE: [AccessDevelopers] Keeping users away... Trent Johnsey
- Re: [AccessDevelopers] Keeping users ... Toby Bierly
- Re: [AccessDevelopers] Keeping us... Trent Johnsey
- RE: [AccessDevelopers] Keeping users away fro... Cathy Jupp
- RE: [AccessDevelopers] Keeping users away fro... Hoffman, Tobi K (DYS)
- RE: [AccessDevelopers] Keeping users away fro... Hoffman, Tobi K \(DYS\)
- RE: [AccessDevelopers] Keeping users away fro... Cathy Jupp
