Is there a VBA statement that will return the string of the procedure that is executing?

  • Thread starter Thread starter Jon A
  • Start date Start date
J

Jon A

When on a form named frm_MyForm I can include the statement

Debug.Print "Form = " & Me.name

and I will get the result of

Form = frm_MyForm

Is there a similar statement or property that will print out
the name of the procedure that is running?

For example, if the currently-executing procedure is the
Form_Open event procedure, then I would like to print out
something like this

Procedure = Form_Open
 
Much to our chagrin, there isn't such functionality in VBA.

Most of us hard-code a constant or variable in each routine.

Assuming you're using Access 2000 or newer, take a look at the free add-in
from http://www.mztools.com
 
Thanks for the lead to the tool. It looks like it might be
very useful. But it didn't get loaded and I can't find
information on the website to address it. Any thoughts?

Here's the story:
I have Win XP Pro SP2.
I am developing in Office 2003 but for Access 200 mode.

I downloaded it.
Put it into C:\Windows\MZTools.
Right-click on the DLL and selected "Register".
Got the message that it was registered successfully.
Started Access and VBA.
I don't find it anywhere.
Looked on the website - found no details on loading it.
 
It's not under Tools for you when you're in the VB editor?

Try contacting Carlos. There's a Contact option on the left-hand side of the
webpage.
 
Back
Top