If you want to execute code with a menu button, you need to put the code
inside a function either behind the form or in a module. Code to open a form
would look like:
MyFunction()
DoCmd.OpenForm "MyForm"
End Function
Then in the Action property of the button, you would put:
=MyFunction()
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
"adrianm4380" <adrian.pilch@healthnetworklabs.comwrote in message
news:1184091953.126072.323390@d55g2000hsg.googlegr oups.com...
Quote:
Is it possible to call the on click event procedure for a command
button on a custom toolbar? I have a menu of buttons that open various
forms in varying ways that are all controlled in the on click event. I
would like to be able to reference these events in a custom toolbar
instead of creating macros. If I can create code to open a form in VBA
why can't I use that code to open the form from the toolbar? Can
someone explain to me how this is done? I'm not sure what the correct
syntax would be to accomplish this. Thanks in advance.
>