>I have a VB module that has the following function which is referenced in the ON ERROR GOTO statement:
>
>TRAP:
> Screen.MousePointer = vbNormal
> MsgBox "An error has occured in ProcessTables: " & Err.Description & " (" & CStr(Err.Number) & Err.Source & ")", vbCritical
> RaiseEvent Status("Errors occured during table processing.")
> ProcessTables = False
> Exit Function
>
>How do I add the line number of the code which triggered the error event to this statement?
>
>Thanks,
>
>Ben Holton
There is a way, but it's not pretty. VB inherited a function from the good 'ol days called "Erl" (Error Line). The ugly part is that you have to add line numbers to your code (eeeww..). It's undocumented in the newer versions of VB.
I've used it only once when I had a squirrely error I could not put my finger on. Once I fixed the problem I took out the line numbers and the call.
Also, I believe there is a third party vendor that sells a gadged that will do this for your projects. You may find some info on this at
www.devx.com.