Hello all!

How to i cam automatic get the original name of a function when an error occurs, and how to i cam handle one global procedure to error treatment?

see this code:

VB Code:
  1. Private Sub MyFunction()
  2. On Error GoTo GlobalErrorTreat:
  3.  
  4. Dim x As Integer
  5. Dim a As String
  6. Dim r As Boolean
  7.     a = "a"
  8.     x = 1
  9.     r = a * x ' this generate an error
  10.     MsgBox r
  11. End Sub
  12.  
  13. ' in a global module or class
  14. On Error GoTo GlobalErrorTreat:
  15. MsgBox "This error ocurr in : " & FunctionName
  16. 'how to get FunctionName is my problem...
  17. Resume Next

Thanks!