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.
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