on action commandbars

When customizing a toolbar and adding custom buttons, there is an on
action box. I understand that I can type a name of a VBA function
there. But I was wondering why it's a combo box. Is there a way to get
my VBA functions listed there, so I can just select from the list?

Jennifer

0
Toxalot
8/20/2007 5:37:16 AM
access 16762 articles. 3 followers. Follow

2 Replies
1941 Views

Similar Articles

[PageSpeed] 24

I would say that 90% of my custom menu bars call, and run my VBA code.

All you need to do is make the code (a function) public, and then simply
place the function name in the buttons on-action event code.

Further, likely often you will have specific code to a particular form, and
once again, you simply declare those functions (in that form) as public.

The syntax to call the code then is:

=YourFunctionName()

Also, if the code you write is for the particular form, then as mentioned,
you can simply place the code into the forms module code.

There is not a "drop down" list as you ask.....

Often, (if not most of the time), if going to place the code in a "standard" 
code modle for use by MORE THEN one form, then your code you call will need 
to pick up
some information about the current screen etc. So, my code most of the time
starts out, and grabs the current screen name. I use:

Public Function AskInvoicePrint()

   Dim tblgroupid    As Long
   Dim frmActive     As Form

   Set frmActive = Screen.ActiveForm

   tblgroupid = frmActive.frmMainClientB.Form!ID

   If frmActive.InvoiceNumber = 0 Then
      frmActive.InvoiceNumber = nextinvoice
      frmActive.Refresh
   End If

   DoCmd.OpenForm "guiInvoicePrint", , , "id = " & tblgroupid

End Function

The above is code that the invoice print button runs. note how I right away
pick up the active form. After that, I can easily ref the forms object as if
the code was running much like the code would if put behind a button on the
form. In the above example, I also check if a invoice xnumber has been
generated before printing. And, the Refresh forces a disk write if in fact I
do change the invoice number. And, in addition the above clip also passes
the currently selected sub-form item that the invoice print form needs.


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com


0
Albert
8/20/2007 5:57:04 AM
The "drop down" that I was referring to is in the propeties of the
menu item when you are customizing the menu. I discovered that the
drop down is populated automatically with macros, but I will just
stick to manually typing in the function name rather than creating a
whole bunch of macros.

On Aug 20, 2:37 am, Toxalot <toxa...@gmail.com> wrote:
> When customizing a toolbar and adding custom buttons, there is an on
> action box. I understand that I can type a name of a VBA function
> there. But I was wondering why it's a combo box. Is there a way to get
> my VBA functions listed there, so I can just select from the list?
>
> Jennifer


0
Toxalot
8/22/2007 7:10:05 AM
Reply:

Similar Artilces:

Message when adding additional mailbox to outlook: The name could not be resolved. The action could not be completed
I'm having a really strange error with some users mailboxes in Exchange. Firstly, this is isolated to a small number of users and applies across all computers for those users. When I try to tell outlook (2000 or 2003) to open additional user mailboxes for a few isolated users, the moment I hit the add button (before even being able to enter the other mailbox names or anything else) I receive the message "The name could not be resolved. The action could not be completed". I've tried doing this for the affected users on other computers (same result), different outlook versio...

Form Assistant 'Follow Up' action not associated correctly
We have a problem whereby the following occurs: User selects an activity, typically a Phone Call and after completing the physical call, selects to 'Follow Up' from the tool bar and then enters the relevant data in the Form Assistant that appears. When the follow up task is saved or saved and opened, the resulting task has no Sender, Recipient or Phone Number associated with it. The user believes this was working before and I can recreate it- has anyone seen this issue before? This is on CRM 3.0 with Rollup 2. Thanks Leigh Hi Leigh, I am using CRM 3.0 rollup 1 and notic...

Setup Project Install Custom Action
I have a Setup project that implements an Install Custom Action that will create the database for the application being installed. It first checks to see if the database already exists and if so, asks the user via a message box if they want to keep it. Most of the time this message box appears BEHIND the setup wizard window. It appears that the setup just freezes. If you drag the setup wizard window away, you can then see the message box and respond to it. Is there any way to make sure that this message box is displayed on top of the setup wizard window? I'm sure you could use ...

excel auto fill needs to be have default action (series,copy...) .
excel auto fill needs to be have default action (copy cells, fill series, etc) set in cell properties. That way a column of data that is never to be a series can be drug with default COPY where a column of data that does require series can be drug with default series. There can be groups of cells instead of entire columns that this applies to, so setting it as a cell property is the best implementation. personally, i did't think holding the control key down while dragging was that difficult .. however, if you want to let MS know your thoughts then email them on mswish@microsoft.c...

Could not install custom actions. The object could not be found.
How do I easily fix this Please see http://www.officeforlawyers.com/howask.htm -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.htm Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "Help" <Help@discussions.microsoft.com> wrote in message news:168E404F-B740-4DEB-9F5A-83D3E1BA2DB9@microsoft.com... > How do I easily fix this > ...

the cursor move to TO: field when reply action requested
Problem: Outlook 2000 Open an email and press REPLY. The cursor stays on the TO line instead of going directly to the BODY of the email document. Thanks I have seen intermittent reports of this but have not been able to find a common denominator --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After furious head scratching, Sang Nguyen asked: | Problem: Outlook 2000 | | Open an email and press REPLY. The cursor sta...

"IF" with no "false" action
All, I am sorry to start this as a new thread - but I think some may see the original as closed, and not look at any new posts. Just looking for some help :confused: ------------------------ Can anyone help with a variation if this earlier thread? This is exactly what I am looking for, except I am not using a date function - I am using text. so, I have few cells that look like this. (actually have about 8,000 cells worth of info on the spreadsheet.) .. A 1 BOB 2 3 4 5 MIKE 6 So, what I am trying to is this - just what I thought might work... a2 is blank, it should = a1 - thats...

RePost: The command or action quit isn't available now
Please Help. Thanks. Hello, I recently upgraded from Access 2003 to Access 2007 and I am completely lost. My PC is running WinXP. While creating a new db, I created a macro where is should close Access once the macro has completed. The macro action is called "Quit". When I run it, I get an error (The command or action quit isn't available now). Possible causes it gives are: You may be in a read only db (How can I check this?) or a db from an earlier version of access (This is a new db created and saved in Access07). The type of object the action applies to isn...

Mix and match MSDN and Action pack licenses
My company has MSDN licenses to CRM (5-pack) that we installed on our sandbox to test/play with. However, we also have 5 licenses from our MS Partner Action pack subscription. The problem is that I cannot add the Action pack licenses (licenses under my company name) to the CRM installation that has the MSDN licenses (under "MSDN Subscriber" name in CRM Deployment manager->License manager) I do not want to reformat the system or use two separate CRM systems with 5 licenses each. How can I use both these licenses in the same system? Thanks for all help. -----------------------...

commandbar in outlook
Hi all. in outlook when i click new Message email. I created a Command bar. All events at here is action. But when have a Commandbar button to hide at chevron. Then it lost events. I don't know why. Can you help me? Thank you -- trongd ----------------------------------------------------------------------- trongdu's Profile: http://www.officehelp.in/member.php?userid=532 View this thread: http://www.officehelp.in/showthread.php?t=127448 Posted from - http://www.officehelp.i ...

searching for specific criteria and then doing an action based on
What I am trying to do is search down a column of times that are in h:mm format. All of the cells display a time even if I do not add a specific value it shows 0:00 which I understand since I formatted the cells in this format because it is necessary for this project. But what I want to do is search this column for any time other than 0:00 and then write the value in the box next to that cell in a seperate cell. any help would be appreciated. Thanks Bill Assume times in col A Put in B1: =IF(A1=0,"",A1) Format B1 as time Copy down -- Rgds Max xl 97 --- GMT+8, 1� 22' N 1...

552 Requested mail action aborted: exceeded storage allocation
I have a home user that is using a Hotmail account to communicate with our company. She can email us perfectly fine when she composes a new message...however, when she attempts to reply to a message sent from us, she is getting back and undeliverable message as follows: name@domain.com SMTP error from remote mailer after end of data: host mail.domain.com [xx.x.xxx.xx]: 552 Requested mail action aborted: exceeded storage allocation She gets this message even with no attachements. The host domain name and IP address are both correct as well as the email address (obviously since...

How to stop keys action while running dialog application
hi i am developing a Dialog based MFC application where i have to stop any key pressed action (from keyboard like ESc, ALT + TAB, CTRL + Break, CTRL + ALT + DEL). could anybody plz tell me about this problem. Regards Mujtaba I use ON_WM_GETDLGCODE() and return DLGC_WANTALLKEYS; in the routine. Then I can handle OnKeyDown. I use this for Tab / Esc, Return etc. However, I don't think you are supposed to interfere with CtrlAltDel, AltTab etc. So I do not know if this works for those keys. "Mujtaba" <tomujtaba@hotmail.com> wrote in message news:8f4f92aa.0404130716.427...

Cannot delete a table with a macro action
In Access 2003, I am developing a database and create a temporary table with a make table query. Once I am done with the table and have closed all objects based on that table, Access will not alow me to delete the table with a macro action "DeleteObject". It tells me that the data base engine could not lock the table because another user is accessing it. There is no other user and no object is open which is connected with that table. I have tried everything I could think of, in vain. When I close the error mesage and select the table in the database window, I can delete it. I ...

Actioning Icon
I have created a form. I would like to create an icon to save and to search. ie. 1. If i click the icon the data to be saved in a related table 2. After entering any text in a field , if I click a icon (search) the particular data may come in form. Hi Siva: By no stretch of the imagination am I an Access guru and I am sure there are a lot more people on this site that can help you more than I. It sounds to me what you need is to add some command buttons and place the VBA code behind them to perform the functions you are looking to perform. When you create the c...

Macros actioned by drop down list
I have a drop down list in cell C1 list being validated from a list o 53 cells: A1:A53 (cell A1 being "week1" , cell A2 being "Week 2" etc) I will record 53 macros (Macro "week1", etc). 1- Is it possible to assing the macro "Week 1" to cell A1 ? (It is not a basic shape. Just a value in the cell.) 2- After assigning each macro to each cell, is it possible to start th macros in Cell C1 by choosing from drop down list.? ( Example. in cell C1 I select "week25" and by doing this macr "week25"starts running -- Message posted from ...

"Right-Click" actions
I thought I'd remembered reading somewhere that "Right-Click" actions could be assigned to controls. Yet, I don't see a "Right-Click" option given in the "Events" tab of a combo's property sheet. It seems that the "Right-Click" action can only be specified at the form's level, is that the limitation? Bill I stab in the dark, but couldn't you use the On Key Press Event to verify if the right-click was used and if so execute some code? -- Hope this helps, Daniel P "Bill" wrote: > I thought I'd remembered ...

Action Pack and CRM 4.0
Does anyone know when Action Pack subscribers can expect to receive CRM 4.0? I believe there is a January 2008 shipment - would it be included then? If not, is there any way for Action Pack subscribers to access 4.0 beforehand? That will be hard to tell, since v4.0 has not been RTM yet. The actual release date can be a moving target. I think the public announce target date is Q1, 2008. Frank Lee, Microsoft CRM MVP http://microsoft-crm.spaces.live.com http://www.workopia.com/Links.htm "Jason Mutchler" wrote: > Does anyone know when Action Pack subscribers can expect t...

You can't carry out this action at the present time
I am working on a database that is used at a number of similar organisations. I recently added an audit trail to this using a slightly adapted version of an example I found on this newsgroup. This consists of calling a module BeforeUpdate which assigns any changes into an invisible field and running the following code AfterUpdate to assign the change into an Audit Trail table: Private Sub Form_AfterUpdate() On Error GoTo Err_AfterUpdate_Click Dim strName As String, StrSql As String Dim FormID As String Dim Changes As String strName = CurrentUser() FormID =...

REPOST: OWA: "The action can't be performed" when sending email
PLEASE HELP, I HAVE THIS PROBLEM ALREADY TOO LONG! See title. [repost of 29-07-2006:] Further more, I investigated the errors and. Note: I have (for troubleshooting reasons) given mailbox full access from every user to every users mailbox (I inserted the usernames each, giving full access): - every admin (can access and) can send email out of every mailbox - normal users (can access and) can ONLY send mail out of his own mailbox - normal users (can access but) can't send mail out of other user's mailbox It seems like an authentication problem, that does not give 'normal'...

How do I change the action of button in Access 2007 contact list?
I need to change the email address manually when I click the "send email" button to create new email directly from Contact List of Access 2007 as the default email address is including the receiver name (name + emal address was recognized as wrong email address by Windows Live Mail). How to change the default setting of Access 2007? -- THANKS & BEST REGARDS, Nguyen Tung Director of Sales and Marketing --------------------------------------- THIENTHAONGUYEN TRANSPORTATION CO., No181 Dai Tu Str,Hoang Mai Dist,Hanoi,Vietnam Tel :(84.4) 36410 577 - 107 /...

CRM - Action Pack
I received CRM 1.2 as part of my Action Pack Subscription. I'm trying to install it on a server I just setup and it won't take either of the product keys on the back of my CD sleeve. You need to go through a registration process to hget the "real" CRM org name & key from MBS. The actual license key is tied to the org name and they have no idea what org name would be used when they package the Action Pack, so they can't gen it up front. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Sat, 21 May...

How do you activate "A custom action" in Rules
Can the "A Custom Action" function be used to delete outgoing mail that is being auto sent from my Contacts by a Trojan that I am unable to remove from my computer? If this is not a solution, is there a fix that I can use? I have isolated the trigger incoming mail that causes mail to go out. You can apply rules only after the mail has been sent. You would be better off asking for help on fixing the problem, not treating the solution. -- ~jason k "Gregory V." <anonymous@discussions.microsoft.com> wrote in message news:00ef01c3cf5f$a85a2a70$a001280a@phx.gbl......

Email Via MailMerge not exists in action list when quick campaign
Hi, In microsoft crm we can create a quick campaign from outlook or IE. In my network, I have three users , they have same roles. and all install the CRM client for outlook. But in one computer: The "e-mail via mail merge" is not shown in "Select the Activity type and owners" window. when create quick campaign for selected marketing list either in outlook or IE one computer has it in outlook but not in IE one computer has it in both outlook and IE Any idea? -- Gordon ...

Prevent the table modification message in action query
-- Wendy "Wendy" <Wendy@discussions.microsoft.com> wrote nothing in message news:3702E87B-3F08-42A5-9A04-4B7592A46FE6@microsoft.com... See: Action queries: suppressing dialogs, while knowing result at: http://allenbrowne.com/ser-60.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. ...