There is no way to get the name of a module as far as I know. I've created an add-in that adds the name, as:
Code:Private Const THIS_MODULE As String = "BMain"
to the tops of all of my modules, forms, classes, user controls. It also adds:
Code:Const THIS_CONTEXT As String = "Main"
to the beginning of each function, sub, property, etc. This information together with the undocumented "Erl" property, which indicates the current line number when an error occurs, combine to create a pretty effective Error logging system in my apps. . . .
I had wanted to add an URL showing the basis for my error handling strategy. MSDN used to have a pretty good technical article. Alas, with .NET out M$ seems to be purging out a lot of good information on how to use their, now legacy, older versions of VB :-(
For more info see:
Erl Property
HTH
Jim
Enter your message below
Sign in or Join us (it's free).