wiklendt
i recommend chocolate
- Local time
- Today, 21:19
- Joined
- Mar 10, 2008
- Messages
- 1,746
Hi guys. i wanted to use the name of the subroutine/function that is running as a string in my error handler, but i don't know how to reference it.
what i hope to get is: when i get an error, let's say
i would prefer to have
instead BUT i don't want to have to manually change the "cmdOpenReport_Click" for each subroutine, hence finding the 'name' of the code using some VBA.
i normally (until i learn how to globalise my error handling - also so that i can change the app title in the message box title bar very easily!) just copy and paste "my" error handler over the access standard one, so i prefer not to be changing that value manually.
does anyone have an idea how to do this? it's possible i'd like to do this for other code not just subs (e.g., functions) and i don't know if it will make a difference if they are private/public either...
any ideas or nudges welcome
what i hope to get is: when i get an error, let's say
Error #94: invalid use of null
i would prefer to have
cmdOpenReport_Click Error # 94: invalid use of null
instead BUT i don't want to have to manually change the "cmdOpenReport_Click" for each subroutine, hence finding the 'name' of the code using some VBA.
i normally (until i learn how to globalise my error handling - also so that i can change the app title in the message box title bar very easily!) just copy and paste "my" error handler over the access standard one, so i prefer not to be changing that value manually.
does anyone have an idea how to do this? it's possible i'd like to do this for other code not just subs (e.g., functions) and i don't know if it will make a difference if they are private/public either...
any ideas or nudges welcome