By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

CommandBarButton OnAction Property

P: n/a
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

Apr 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Also, are there any alternatives to the CommandBars for easily creating
popup menus in VBA? Thanks.

-Vincent

Apr 12 '06 #2

P: n/a
Vincent wrote:
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.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 13 '06 #3

P: n/a
Vincent wrote:
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.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 13 '06 #4

P: n/a
"Vincent" <an**********@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
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


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)

--
Lyle Fairfield
Apr 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.