I'm getting into adding right click menu "command bars" in a form.
This is the environment as far as modules and procedures go:
Menu program
Form 1 > Form 1 Class module > Standard shared Form module
Form 2 > Form 2 Class module > Standard shared Form module
Form n > ...
(The > means that one object calls another, Standard shared Form module for lots of routine form tasks.)
The menu form builds a standard right click menu that works for 95% of the forms and their controls (textboxes, combo boxes)
The app is multilingual, and the menu form knows the current language, so this is a good place to build the right click menu for all the forms to use, instead of building one unique right click menu each time a form loads.
Looking at something as simple as displaying a help for a control, it makes sense to add one procedure in the Standard shared Form module. To do this help, I need the Me (the form) and an array that has some control variables. In my reading, the right click would call a public function. The problem I'm seeing is how to get the Me (form) and control array to the Standard shared Form module when a right click happens.
I got it to work by adding a routine to each Form n Class module, but this is very repetitive and creates lots of command bars and functions, one for each form, which seems kind of silly.
Is there a way to get at the Me of a form and an array tied to the form's VBA that a standardized function for right click menus can use?
I looked at these two blogs, and I'm a bit lost (I'm not sure they address this problem):
Add a Custom Right-Click Menu to an Access Control (nolongerset.com) (maybe, but it doesn't address the array part of the problem)
Understanding and using CommandBars, Part II (Creating your own) | Experts Exchange (experts-exchange.com)
Any tricks to do this?