Connecting Tech Pros Worldwide Help | Site Map

Calling Command Button On Click Event from a Custom Toolbar

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 10th, 2007, 06:35 PM
adrianm4380
Guest
 
Posts: n/a
Default Calling Command Button On Click Event from a Custom Toolbar

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.


  #2  
Old July 10th, 2007, 06:35 PM
Steve
Guest
 
Posts: n/a
Default Re: Calling Command Button On Click Event from a Custom Toolbar

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.
>

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.