Is it possible to fire an event when the user clicks a custom toolbar
button?
Bob
Marshall Barton - 31 Jul 2007 17:13 GMT
>Is it possible to fire an event when the user clicks a custom toolbar
>button?
Tool (and menu) bar items have their own interal click event
that calls the function you specify in your custom command
bar item's OnAction property.
The built-in command bar items call their own internal
procedure. You can change the OnAction property of the
built-in buttons, but it would be a bad thing because it
would change the items behavior across your entire
applcation (and maybe even all of Office). Instead create a
new command bar item and use your own code to do what you
want as well as what the real item does.

Signature
Marsh
MVP [MS Access]
Maurice - 31 Jul 2007 17:16 GMT
You could assign a macro to it.

Signature
Maurice Ausum
> Is it possible to fire an event when the user clicks a custom toolbar
> button?
>
> Bob
Albert D. Kallal - 31 Jul 2007 19:30 GMT
I am not sure what you mean by "fire an event"
You can certainly have a custom button call VBA code (that normally how I
use custom menu items).
That code can most certainly "call" some event code you have in a form.
So, if you wanted to call the after update event of a particular control,
say "company" name after update event, the you could simply put a pubic
function in your form call
Public Function MyCoAfterCall
Call CompanyName_AfterUpdate
end if
and, then for the custom menu/tool bar on-action, you go
=MyCoAfterCall()

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com