I am trying to dynamically populate the module name in the error
message.
Currently I populate a variable with hardcoded text:
strModuleName = "cmdFlushWorkTa bles_Click"
Per my code below, is there a way to populate strModulename
dynamically so that all I would need for the error message is the
message line itself? Is there some API call I can make that will
disclose the current module running so that when the error is raised,
that modulename would dynamically show up in my error message? If
there is a code sample for this, I would appreciate the assistance.
<begin code>
Private Sub cmdFlushWorkTab les_Click()
On Error GoTo Err1
Dim blnReturn As Boolean
RunSQLReturn ("Delete * from tblCurrentMonth Data")
Exit1:
Exit Sub
Err1:
strModuleName = "cmdFlushWorkTa bles_Click"
MsgBox Err.Number & ". " & Err.Description , vbExclamation,
gblPgmName & "-Error in " & strModuleName
Resume Exit1
End Sub
<end code>
Thanks.
message.
Currently I populate a variable with hardcoded text:
strModuleName = "cmdFlushWorkTa bles_Click"
Per my code below, is there a way to populate strModulename
dynamically so that all I would need for the error message is the
message line itself? Is there some API call I can make that will
disclose the current module running so that when the error is raised,
that modulename would dynamically show up in my error message? If
there is a code sample for this, I would appreciate the assistance.
<begin code>
Private Sub cmdFlushWorkTab les_Click()
On Error GoTo Err1
Dim blnReturn As Boolean
RunSQLReturn ("Delete * from tblCurrentMonth Data")
Exit1:
Exit Sub
Err1:
strModuleName = "cmdFlushWorkTa bles_Click"
MsgBox Err.Number & ". " & Err.Description , vbExclamation,
gblPgmName & "-Error in " & strModuleName
Resume Exit1
End Sub
<end code>
Thanks.
Comment