MS Access Hotkeys: Calling a function from a macro

Hello Experts,

I am using Access 2013 / Windows 7 64-bit.
I have a function in a standard module that closes all open forms except for the main navigation form. It works perfectly when placed behind a command button, so the code is fine. It is pretty useful, but would be even more so if I could run it by pressing a function key on the keyboard (F1, F2 etc).
To this end, I have created a macro called "Autokeys"; this contains a submacro called {F3}, and I am trying to call the form closing function from this but it is not working for me.
The name of the standard module is S_CloseAllForms, and the name of the function within this is Public Function CloseAllForms(). I have tried to call the function from the AutoKeys macro using "execute procedure", "execute macro", "execute application" and "execute data macro" options, naming the function "S_CloseAllForms.CloseAllForms" and various variations thereof. Depending on the combination I get either no response or error messages mostly saying that the function cannot be found. I would be most grateful if anyone could point me in the right direction.
Paul McCabeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paul McCabeAuthor Commented:
Actually, I am using a Japanese system, and "Run procedure" was my literal translation for "RunCode". But your comment helped me focus on "RunCode" and I finally figured it out; I just needed the function name with the parentheses following. So in the Autokeys macro, I should have just named the function as "CloseAllForms()". Although I had already read that article before, I overlooked it as it is embedded in a rather technical explanation. Amazing how much frustration something small like a pair of parentheses can cause. Thank you for being the catalyst that got me there !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.