Menu buttons that run code

R

Rod

Is there a way to run code from a menu button, avoiding
creating a macro to do so?

Thanks... Rod
 
J

John Spencer (MVP)

Yes, you have to write a function in a module and then call that from the button.

For instance if the function is named fGetInfo then you place that in the On
Action property of the button.
 
T

Tim Ferguson

Yes, you have to write a function in a module and then call that from
the button.

For instance if the function is named fGetInfo then you place that in
the On Action property of the button.

On Action fGetInfo <<<---- No Parens at end

Just to add, because it fooled me for ages:-

It _must_ be a Function and not a Sub even though it does not return a
value. Don't ask me why, perhaps the Access GUI team do so much C++ work
that they forgot their o-level programming...

B Wishes


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top