Returning Private Sub Name In Error Message

I have a command button on a form to delete the current record. The corresponding subroutine is called Private Sub cmdDelete_Click(). I'm looking for a way to display "cmdDelete_Click" in an error message if an error is thrown. I want to have the the statment be the same for each subroutine I have so I don't have to hard code the name for each one. Is there a way to return the name of the current subroutine as I described? I found something like form.module.name but that wasn't it.
[489 byte] By [VisualDBA] at [2008-1-12]
# 1
You can pull that information out of the Exception object, here is a good example of doing just that:
http://www.jasonbock.net/JB/ExceptionDialog.aspx
-James
JamesAvery at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2
Thanks James. That link is dead at the moment. Do you have an example on hand?
VisualDBA at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3
I just checked and it should be working now:
http://www.jasonbock.net/JB/ExceptionDialog.aspx
If it doesnt work send me your email and I will email you the example code. (javery @~ no spam ~infozerk.com, remove the nospam part)
Thanks,
-James
JamesAvery at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 4

Here's an example - which will display the Assembly and function name that the exception was thrown in.
Try

Catch ex As Exception

dim sprocedurename as string

sprocedurename = ex.TargetSite.DeclaringType.Assembly.GetName().Name & ": " & ex.TargetSite.Name & "()"

End Try

spotty at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic Language...