473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

CommandBarButton OnAction Property

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
4 8258
Also, are there any alternatives to the CommandBars for easily creating
popup menus in VBA? Thanks.

-Vincent

Apr 12 '06 #2
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Johan Christensson | last post by:
Hi. I'm woundering if it's possibel to transfer a OnAction value from a drop-down box in an ASP page without having to use Java code? I mean something like this: <% Sub resposeprocess
1
by: G.Gerard | last post by:
Hello Does anyone know how to write a function name with arguments in the OnAction of a command bar button: Example: Public Sub MyFunction(strMsg as String) Msgbox strMsg
3
by: Paul | last post by:
This is MS Access 2002. I am creating some custom buttons on a CommandBar for a form. Below is the code. It works fine except that the OnAction procedure is executed twice. Why? How can I fix...
0
by: maitrepoy | last post by:
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office. This is...
0
by: Galin iliev | last post by:
Hello guys I 've been digging for a while trying to add nice image to CommandBarButton in MS Word using VS 2005 without aby luck. I found http://blogs.msdn.com/vsto/archive/2003/12/18/44404.aspx...
6
by: Ken | last post by:
Please help I've been working on this for over a day. The following code will run the GetComments function from a shortcut menu. .MoveFirst Set cmb = Application.CommandBars.Add("Comments",...
1
by: ApexData | last post by:
I have a ShortCutMenu that is made available on the RightClick of the mouse. The OnAction property has my custom function: =ComboBoxEditor() I believe that, in the ONAction property, I could do...
1
by: arnott | last post by:
hi all, I am writing a add-in for Outlook 2007 using C# and VSTO ( Visual Studio 2008). When the user clicks on each mailitem in the inbox (or any folder) in the active explorer window, the...
2
by: grusso | last post by:
well, i need a table with all functions for onaction sentence. where i can obtain? thank yourssss
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.