This might be a simple question, but I am trying to get the name of the Private sub into a text string. I have an error handler in my vba code, but when the error pops up, it does not specify where the error is, since the codes call different private subs. So what I am doing now is changing the title of the error message box to be the form name and the name of the Private sub, but I am not having any success. I can just copy and paste the title into the string, but I have possibly 500 different Private subs, so copying a line of code would be easier. This is what I have:
Me.Module returns "Forms_Invoices", the name of the form, which is perfect. I tried me.Name, but that just gives me the name of the form, "Invoices". Now to get the name of the Private sub. Any help is greatly appreciated.
Code:
Private Sub DisableGetShippingTaxes()
'I removed my code, since it is not necessary for this question.
My_Error_Handler:
Select Case Err.Number
Case Else
MsgBox _
"An unexpected error has occurred. The system's description " & _
"of this error is:" & vbCr & vbCr & _
"Error " & Err.Number & ": " & Err.Description, _
vbExclamation, _
[COLOR="Red"][B]Me.Module & "_DisableGetShippingTaxes"[/B][/COLOR]
Me.Module returns "Forms_Invoices", the name of the form, which is perfect. I tried me.Name, but that just gives me the name of the form, "Invoices". Now to get the name of the Private sub. Any help is greatly appreciated.