Hi friends,

I'm trying to "uniformise" my error handling syntax from one form to another, or from one module to another.

I explain.

I have a sub I call on each error:

Code:
Public Sub ErrorLog(sFunctionName As String)
...
End Sub
I call it like that :
Code:
ErrorLog "frmMain.CkAssign_Click"
where frmMain ist the form name, and CkAssign_Click the sub I want to write in the report generated by ErrorLog.

I have several forms so I changed for :
Code:
ErrorLog Me.Name & ".CkAssign_Click"
So rest me to change it for something to get the function/sub name and have a command like this
ErrorLog Me.Name & "." & sub_or_function_name

Also, "Me" runs only for forms. I would find something that can get the name of the "sheet" (Form, Module, Class..) so having a command like this :
Code:
ErrorLog Sheet_Name & "." & sub_or_function_name
I hope my explation is clear enough

Is it possible or not ?

Thanks