473,473 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Create 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(strMsg 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 4229
Try the follwing:

=MyFunction("Hello 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
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
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...
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...
3
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...
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",...
4
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...
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...
16
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...
2
by: grusso | last post by:
well, i need a table with all functions for onaction sentence. where i can obtain? thank yourssss
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
1
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.