ineedhelplease
Technical User
I have an access application that has nearly 70 procedures or functions that run daily, with more being added as people make changes to the application.
I have created a sub - prcLog(prcName as string) - that will log the start and end of each sub or function, for the purpose of tracking how long each procedure runs along with other reporting metrics. In addition to recording various performance metrics, I will use this sub (prcLog) to identify which sub or function quits running if an error occurs.
At this time I pass the current running sub's name manually to the prcLog sub as shown below:
Dim prcName as string
prcName = "thissub'sname"
prcLog(prcName)
The problem with this is when a new sub is created and if the individual is not paying attention and forgets to change the prcName to match the sub's name, anything logged for that sub is useless.
To the question; is there a way I can get the current subs name with code, so that this can be passed to the prcLog sub dynamically? Or is there a way for the prcLog sub to get the sub or function’s name that has called it?
Any help would be useful.
Thank you.
I have created a sub - prcLog(prcName as string) - that will log the start and end of each sub or function, for the purpose of tracking how long each procedure runs along with other reporting metrics. In addition to recording various performance metrics, I will use this sub (prcLog) to identify which sub or function quits running if an error occurs.
At this time I pass the current running sub's name manually to the prcLog sub as shown below:
Dim prcName as string
prcName = "thissub'sname"
prcLog(prcName)
The problem with this is when a new sub is created and if the individual is not paying attention and forgets to change the prcName to match the sub's name, anything logged for that sub is useless.
To the question; is there a way I can get the current subs name with code, so that this can be passed to the prcLog sub dynamically? Or is there a way for the prcLog sub to get the sub or function’s name that has called it?
Any help would be useful.
Thank you.