I have the need to call a form's (public) procedure from a function where the procedure name is passed as a parameter. I have managed to get this working using the EVAL function but the problem is that it runs twice. Does anyone know of how else this can be accomplished (without moving all of my procedures to standard modules)?
For example, in my application I have created popup menus and have set the action as "=processShortcutMenu()". I have defined that function in a standard module as:
Public Function processShortcutMenu()
Dim cmdbarCtl As CommandBarControl
Set cmdbarCtl = CommandBars.ActionControl
Eval ("Forms(" & Chr$(34) & application.CurrentObjectName & Chr$(34) & "
." & cmdbarCtl.Tag)
End Function
The commandbar tag is the name of the procedure in the form that I want to run. This works but it runs mulitple times.
I am also trying to use this concept in other areas other than popup menus so it is very important for me to figure out how to do this.
For example, in my application I have created popup menus and have set the action as "=processShortcutMenu()". I have defined that function in a standard module as:
Public Function processShortcutMenu()
Dim cmdbarCtl As CommandBarControl
Set cmdbarCtl = CommandBars.ActionControl
Eval ("Forms(" & Chr$(34) & application.CurrentObjectName & Chr$(34) & "
End Function
The commandbar tag is the name of the procedure in the form that I want to run. This works but it runs mulitple times.
I am also trying to use this concept in other areas other than popup menus so it is very important for me to figure out how to do this.