I was wondering if the CommandBarButton OnAction property would allow
you to specify a function from a module to be called. According to the
post made by Turtle in 1998, the OnAction property can only specify a
macro name. Is this still the case? I agree with Turtle that "this is
pretty funky."
-Vincent
From: Turtle - view profile
Date: Sat, Nov 21 1998 4:00 am
Email: "Turtle" <macderm...@mindspring.com>
Groups: comp.databases.ms-access,
microsoft.public.access.modulesdaovba
OnAction has to be a macro name. However, this macro can contain only
the
one command RunCode and refer to a function (not a sub, but it ignores
any
value the function returns.)
Personally, I think this is pretty funky. It's one of the few places I
know of where professional programmers use macros.
- Turtle
Vincent - 12 Apr 2006 22:43 GMT
Also, are there any alternatives to the CommandBars for easily creating
popup menus in VBA? Thanks.
-Vincent
Rick Brandt - 13 Apr 2006 02:52 GMT
> Also, are there any alternatives to the CommandBars for easily
> creating popup menus in VBA? Thanks.
>
> -Vincent
In the Customize dialog for command bars you can change any of them that you
have created to type Popup.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Rick Brandt - 13 Apr 2006 02:50 GMT
> I was wondering if the CommandBarButton OnAction property would allow
> you to specify a function from a module to be called. According to
> the post made by Turtle in 1998, the OnAction property can only
> specify a macro name. Is this still the case? I agree with Turtle
> that "this is pretty funky."
No it can be the name of a public function. It just can't be a sub-routine.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Lyle Fairfield - 13 Apr 2006 04:14 GMT
"Vincent" <animedreamer@verizon.net> wrote in news:1144877963.868769.220530
@z34g2000cwc.googlegroups.com:
> I was wondering if the CommandBarButton OnAction property would allow
> you to specify a function from a module to be called. According to the
[quoted text clipped - 20 lines]
>
> - Turtle
One can specify the name of a public function and one can specify
parameters for the function as literals as
cbc.OnAction = "=GetComments(1)"
(as per Terry Kreft 2006-01-24)

Signature
Lyle Fairfield