
Getting info when trapping errors???
Quote:
> This may be wishful thinking but...
> When an error occurs is there a way to :
> 1) obtain the name of the form or module that the error occurred in ?
> 2) obtain the name of the function of sub that the error occurred in ?
> 3) obtain the line number of the code that caused the error ?
> I'm attempting to add some robust general error handling functionality to
> my application and it would be nice to show this information to users when
> an unexpected error occurs.
> Thanks in advance
> Jorge
As Tom Jordan said there was an error handling contest on the Access
Developer Network. I liked the CreateErrorStub example provided by
Donald Bradey but I changed the code generator in Fragment(11) which
generates the Msgbox on the next line.
Fragment(11) = TabChar & "MsgBox " & "Application.currentobjectname
&" & Chr$(34) & " - Error in " & ProcName & "()" & ". " & Chr$(34) & "
& Error$" & "&" & Chr(34) & " Err No: " & Chr(34) & " & Err , 16"
MsgBox Application.currentobjectname & " - Error in
FillDownFsnDssn(). " & Error$ & " Err No: " & Err, 16