474,035 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Command bar OnAction

Hello

Does anyone know how to write a function name with arguments in the OnAction
of a command
bar button:

Example: Public Sub MyFunction(strM sg as String)

Msgbox strMsg

End Sub

Now if I write ( MyFunction "This is the message" ) in the OnAction of a
command bar button I get
this error :

can't run the macro or callback function 'MyFunction
"This is the message"'

If a function doesn't have any arguments, simply writing the function name
in the OnAction works well but when
arguments are involved I can't call the function from a command bar button.

Am I using the wrong brackets of quotation marks or something ?

Thanks
G.Gerard

Nov 12 '05 #1
1 4262
Try the follwing:

=MyFunction("He llo Albert")

The above should work.
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1549
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
8
1333
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
3
3631
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 this? Private Sub cmdCreateTestToolBar_Click() On Error Resume Next CommandBars("Test Toolbar").Delete On Error GoTo ErrorFound
3
3649
by: Shane | last post by:
I am trying to create a custom command bar with three custom buttons, however when I try to make the procedure there is no "CommandBar" option to choose from and is not recognized for the following... Dim NtsT1 As CommandBar Dim NtsT1Btn1 As CommandBarButton Dim NtsT1Btn2 As CommandBarButton Dim NtsT1Btn3 As CommandBarButton There is a CommandBarEvents and 2 CommandBarButton to select but no
6
9547
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", msoBarPopup, , True) Do While Not .EOF Set cbc = cmb.Controls.Add(msoControlButton)
4
8302
by: Vincent | last post by:
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
1
2163
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 something like this to allow or prohib the use of the function??? =iif(blnUseThis,ComboBoxEditor(),Msgbox "NotAvailable") Is there a way to enable or disable the actual menu option from even showing on the rightclick of the mouse. For example
16
2772
by: Steve | last post by:
I am working on a database that has a main menu, many sub-menus and some sub-sub-menus. They are all forms that have numerous command buttons on them to open forms and reports in the database. The database has hundreds of forms and reports. I was asked to go through all the menu forms and determine if all the buttons worked, if there were any problems when either the form or report opened and to come up with a list of the forms and reports...
2
2608
by: grusso | last post by:
well, i need a table with all functions for onaction sentence. where i can obtain? thank yourssss
0
10523
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
12119
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11591
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11969
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10294
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4925
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3949
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.