Custom menu: action is not trigger

Hi,
For the first time I am developping an Access application with a
custom toolbar (menu) at the top. I have found various posting or web
sites where people explain how to do the setup. In fact, I have
followed the instructions coming from this web site.
http://www.jamiessoftware.tk/articles/menubars.html

When my application opens, I can see my custom menu at the top of the
form. My problem is the following: when I click on an item in the
menu, nothing happen !!! I have double-ckeck and I have really
associated an action to the menu item. In fact I have tried to
associate the menu item to a macro. And I have also tried to associate
it to a function inside my Module.

Please I need help !!! I can't see what am I doing wrong.

I don't know if it can help but I found strange that if I click on the
right mouse button, I can a menu with the following elements:
 - Form View
 - Formating (is checked)
 - Web
 - Customize ...


0
Magnolia
12/13/2007 6:12:20 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
1062 Views

Similar Articles

[PageSpeed] 33

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()

Often, (if not most of the time), you code you call will need to pick up
some information about he 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.

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 no need 
to pick up the active screen...and you can use me. as you
always used.

If you want to see some sample menu bars, and why I use them, you can read
the following:

http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm


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


0
Albert
12/13/2007 7:43:36 PM
Reply:

Similar Artilces:

How to recreate context menu in CEdit control for Vista?
I am trying to disable the Cut and Copy functions of the standard Context Menu for a CEdit control. I have derived my own CEdit class with an override of the OnContextMenu() function. From examples in this group and from other places on the net I believe I know how to create my own Context Menu. The question is how do I replicate the other options of the default Context Menu such as "Right to left Reading order", "Show Unicode control characters" etc... -- Best regards, FlyingHorse "FlyingHorse" <FlyingHorse@invalid.local> wrote in message news:r29r63...

Public folder default action
When you drag messages between public folders, the default action is "copy". Is there a way I can make that default action "move" instead? ...

NO "AutoPlay" tab in drive WinExplorer context menu: How to prevent auto-popup of WinExplorer when mounted?
Normally in each drive letters WinExplorer context menu->Properties there is a "AutoPlay" tab where it can be defined what to do when a drive/partition is mounted. oK, now assume a running WinXP. I mount a new encrypted file container with the well known TrueCRypt programm to drive letter W: The mount itself is successful. Drive W: appears in WinExplorer. But in addition a second WinExplorer window for the newly mounted drive appears. I don't want that. Unfortuantely the context menu->Properties of this drive W: does NOT have an "AutoPlay" tab where I...

Custom Fit to Page
Does anyone know how to fit multiple pages to page? What I mean by this is I have a worksheet that is 707 rows and I've set the page breaks to break the worksheet into 8 pages. The pages are set to letter size. However, some pages have empty space at the top and bottom, and other pages fill out the page completely. This is because each page has a different amount of rows in it obviously. I want to make it so each page is "fit to page" where there is no empty space at the top and bottom, regardless of how many rows each page has. Hopefully what I'm saying makes sense. ...

"Show Placeholders" in options/view menu does'nt work.
I have a macro that places a large number of pictures on a spreadsheet. I would like the pictures to show as "placeholders" to speed up viewing/editing. The only problem is that this feature (under Tools/Options/View) does not work. All the images are being display normally. I have tried this in Excel 2000/2003/XP with the same result. This feature works great in MS Word. Please help. To see what I'm talking about. Go to Tools/Options/View and check the "Show Placeholders" option. Now insert a picture or clipart. The image will be displayed normally instead of just a b...

Custom Serialization
Could anyone tell me if this is possible please? I have a class which looks like the following Class MyClass public mblnUpdateMyProp1 as boolean public mintMyProp1 as int16 public mblnUpdateMyProp2 as boolean public mintMyProp2 as int16 end class This serializes to <MyClass> <mblnUpdateMyProp1>True</mblnUpdateMyProp1> <mintMyProp1>2</mintMyProp1> <mblnUpdateMyProp2>True</mblnUpdateMyProp2> <mintMyProp1>3</mintMyProp1> </MyClass> Now I know you can control serialization with attributes such XmlElementAtt...

Adding custom fields to dynamically created controls.
I created a custom Outlook (2003) form that imports data from Access to populate user defined fields and create additional controls based on the number of records in an Access query. Everything works fine except the data the user enters for the dynamically created controls don't hold their value when the form is sent. I am quessing that is because there is no user defined fields bound to them. (how do I do this) I have been looking on the net but cannot find anything close enough. Any help (examples) would be appreciated. Look at http://www.outlookcode.com/d/formcontrols.htm, lots of inf...

Forcing users to use a custom Contacts form OR removing Contacts
Using Exchange 5.5 and Outlook 2000 Is it possible to set it so all users use a cusom contacts form for new items in their "Outlook Today" folders? Or better still, is there a way to remove the Contacts folder, or make it point to a folder in the public folders tree? Thanks! Sparks... ...

Help needed with customer address entity
Our company sends out a great variety of documents to clients, each of whom can have multiple addresses. To complicate matters, clients frequently request different document types to be mailed to different addresses. For example, John Doe may want accounting documents sent to his "Home" address, tax documents sent to his "Work" address, quarterly letter documents sent to his "Vacation" address, etc. The easiest way to track this would be to relate my new custom entity 'Documents' to the customer address entity and the contact entity, then customize a fo...

detailed customization
Hi, Just started looking at MS CRM. We have a client who has started using it and want us to do major customizations. I have already added a few custom forms (in the form of external asp.net applications). I want some more info (I have searched this NG and didn't find and conclusive answers) what I want to know is: 1. Can I add a new entity like the built-in entities and then link (mapping?) the new entity to a built-in entity? Basically what I want is to add a new table in the database and then have the ability to create objects accessible through the proxy dll. If it is not possi...

how do I customize my menubar using a2007?
I've move to A2007. The menubar I created in A2003 is still there but how do I now customize it? Jesper I believe that you can only customize it in Access 2003, since 2007 doesn't use menubars anymore. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Jesper F" <jesperfjoelner@hotmail.com> wrote in message news:47e24896$0$90274$14726298@news.sunsite.dk... > I've move to A2007. The menubar I created in A2003 is still there but how > do I now customize it? > > Jesper > >I believe tha...

My Outlook 2003 Will Not Display "Signature" on Insert Menu
For reasons that escape me entirely, my installation of Outlook 2003 on this one computer (on a network of 5) does not display "Signature" as an option on the Insert menu. Instead, it displays Insert Symbol (with S underlined.) If there's a way to change that menu structure through Customize, I don't find that either. It will apparently allow me to rearrange the sequence that options appear on the Insert menu, but will not allow me to delete or add any options. How can I get the Insert menu to display Signature as an option instead of Symbol? I shall greatly appreciate yo...

Chart MEnu Bar Missing
Occasionally my Excel worksheets will no thave the Chart Menu Bar attached to them but will have them on different worksheets. The Chart Menu Bar is the one with File, Edit View, etc. Is there a reason it is missing and if so how do I return it? Thanks, Ryan You probably havent selected the chart toolbar. If it isnt selected it will only appear when you open a sheet that has a chart on it. But then it will not reappear when you close the sheet and restart Excel. Just open excel, select view\toolbars\chart from the menu and then restart Excel. Should work. Jamie, we are not talkin...

Adding a drop down ascending/descending menu in a cell #2
How can I add a drop down menu into a cell with options of ascending and descending? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/ms-excel/200512/1 ...

Error when trying to customize attributes
Recently we had a system failure and ended up restoring our CRM 3.0 to a newer version of 3.0. Everything seemed fine for a while until we attempted to do some additional customizing with the attributes. This is the error we are getting: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an obje...

Export directory entry type mailboxes as type custom recipients (remote)
Hi, As a prelude to the final, way overdue, extinguishing Exchange 5.5, want I want to do is export from the GAL all the mailboxes in the other sites, but convert them in a single operation to type custom recipients (remote). At which point I will remove our x.400 connector, then import all of the custom recipients back into our own administrative group. I am aware that no further directory synchonization will occur. I am aware that there are solutions for sychronizing between active directories (MIIS, federations, LDAP address books, etc.), but I have no cooperation from any other responsi...

Quote for Customer Report Problem
I create a printable quote form using Crystal Reports base don Michael Yourshaw's method (send GUID to aspx page and redirect to the report). But I have a problem. When I press the 'open quote in Crystal' button on the quote form, I have to enter my username and password again to be able to see the report. How can I solve this? Thx! ...

customizations grayed out on the IE toolbar context menu
hello, from some reason, i have many items in the context menu of the toolbar area of IE grayed out. for example: status bar, favorites bar,command bar, etc... even the items in the "customize" submenu are grayed here's a screenshot: http://yfrog.com/e520100111170645crp please tell me how to fix it. We can't do squat to help you until you state your IE version and full Windows version (e.g., WinXP SP3; WinXP 64-bit SP2; Vista SP1; Vista 64-bit SP2; Win7; Win7 64-bit). What anti-virus application or security suite is installed and is your subscription cur...

How to incoke a software action?
I'm trying to figure out how to invoke a software action from the program I'm developing(MS Win2000, VisualStudio 6). Basically I have to open another software, do some stuff like File-Open, tick some check boxes and File-Save, and then close the application. All this is to be done automatically by the software I'm developing. Right now the only thing I was able to find is to use a mouse click automation utility, but I doesn't seem to be a reliable method. I hope I made myself clear. Thanks anyway. Bye Luca Sirluke wrote: > I'm trying to figure out how to invoke...

Hiding menu options
Ca anyone help me with hiding menus and options in xl. I managed this in a very early version of xl but can't seem to be able to do it in the version I have at the moment - which itself is a bit long in the tooth (2002) Application.Commandbars(1).Controls("Format").Controls("Row").Visible = False as an example -- HTH Bob "Alec Mclintock" <AlecMclintock@discussions.microsoft.com> wrote in message news:6EF9E96A-E5EB-471A-AC0B-0F0802D33C07@microsoft.com... > Ca anyone help me with hiding menus and options in xl. I managed...

Exporting Unpublished Customizations
Hello all... We started development of some changes on Production Server A, and we'd like to move them to Test Server B so we can test them before we publish them in production. When I export the entities from server A, and import & publish them on server B, only the already-published entities are available on server B. Editing an entity does not show any of the unpublished changes. Is there a way to move the unpublished changes, or do we need to publish what we've got and hope for the best? We're using CRM 3.0, Rollup #2. Thanks... Travis Hi Travis; there's no opti...

Outlook 2000 shuts down when I click on customize
When I click on customize under Tools my outlook 2000 closes. Does anyone have reason why this happens and how to stop this action. test "Ivan T" <ivant@adelphia.net> wrote in message news:S_WdnfyKUPMOFLbdRVn-jQ@adelphia.com... > When I click on customize under Tools my outlook 2000 closes. Does anyone > have reason why this happens and how to stop this action. > > ...

Publish Customizations Error
Hello, I added some objects to the Scheme Manager and when I assign them to Contacts and try to publish the changes, I get the following error: <Server01>: ***Error*** Failed to download XSL template files from Web Server. Then I check the Event Viewer and find the following error under Application: Event Type: Error Event Source: DMSNAPIN Event Category: None Event ID: 0 Date: 09/09/2005 Time: 14:35:28 User: N/A Computer: <Server01> Description: Web exception Status = ProtocolError Error de HttpGet Unauthorized : The remote server returned an error: (401) Unauthorized....

viewing what each button of a custom toolbar does
Greetings -- I'm reverse engineering a database that I've inherited. There's a couple of custom toolbars, and they open various forms, basically acting as a rudimentary menu system. What I'm trying to do is view whatever action is assigned to each button. Have gone round and round with Tools, Customize, Toolbars, the command tab, etc. Am sure I'm overlooking something. Can anyone help me here? Thanks, Mark Hi Mark, click customize on the menu bar select the toolbar and the button right click the button and on the pop up menu select properties on the propertie...

Spell check & custom dictionaries
Is there a way of specifying which custom dictionary is used by Excel's spelling checker for a particular workbook? and getting Excel to ignore all custom dictionaries when checking spelling on all other workbooks? Any guidance would be appreciated Philip ...