D
Dennis
Hi,
I’m using Access 2003.
I have the following line that I include in my ON ERROR routine:
Call BaseUtil.Dsp_Err_Msg(Err.Number, Err.Description,
"cbPrintReport_Click")
As you see, I currently hard code the name of my routine in my error message
so I can display it in the error message.
I have two questions.
1. Is there a way I can get the name of the current routine from Access so
I do not have to hard code it in each line?
2. Is there a way I can get the current form / report name from Access so I
do not have to hard code it in each line?
Ideally I would like to have the following lines of code in my ON ERROR
routines:
strFormInfo = FunctionToGetFormName & “ – “ & FunctionToGetRoutineName
Call BaseUtil.Dsp_Err_Msg(Err.Number, Err.Description, strFormInfo)
This way when I display the error message, I will automatically know which
routine generated the error message. The form name is really helpful when
I’m in a sub-form.
If I can not do the above, I will setup a standard variable for the form
name & routine name and then just set the variable to the appropriate value.
Thank you for your assistance.
Dennis
I’m using Access 2003.
I have the following line that I include in my ON ERROR routine:
Call BaseUtil.Dsp_Err_Msg(Err.Number, Err.Description,
"cbPrintReport_Click")
As you see, I currently hard code the name of my routine in my error message
so I can display it in the error message.
I have two questions.
1. Is there a way I can get the name of the current routine from Access so
I do not have to hard code it in each line?
2. Is there a way I can get the current form / report name from Access so I
do not have to hard code it in each line?
Ideally I would like to have the following lines of code in my ON ERROR
routines:
strFormInfo = FunctionToGetFormName & “ – “ & FunctionToGetRoutineName
Call BaseUtil.Dsp_Err_Msg(Err.Number, Err.Description, strFormInfo)
This way when I display the error message, I will automatically know which
routine generated the error message. The form name is really helpful when
I’m in a sub-form.
If I can not do the above, I will setup a standard variable for the form
name & routine name and then just set the variable to the appropriate value.
Thank you for your assistance.
Dennis