Passing a forms name to a function (without going into the module behind the form)

Andy Brown
Andy Brown used Ask the Experts™
Using the on-click event handler, I want to pass the current form name to a function using something like this:


This gives me the following error:

"The expression On Click you entered as the event property setting produced the following error: The object doesn't contain the Automation object 'me'"

I can easily do it if I go into the module behind - but for this purpose, I'd prefer not to do that.

Incidentally, the function that I'm trying to call starts as....

Public Function StoreForm(frmName As Form)
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you want to pass the form NAME try:

To pass the form object itself (As the function you demonstrated expects) try

I'm not 100% sure it works, been a while since I used that notation, but give it a try.
Andy BrownDeveloper



The second one worked a treat - thank you Anders.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial