By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Shortcut Menu Bar

P: 90
Hi
.
I came accross a database file having a shortcut menu bar. I imported the shortcut menu bar into my another database file. Where is this shortcut menu bar present in my new database file?
Thanking in anticipation.

.
I came across a database file in .mdb format. This contains a form, in the shortcut menu property of which, there is "agrShortcut" that is displayed on the right click in the form. Further the database also contains a tools bar in the Add-Ins Tab. I was able only to import this Menu to my database. But was unable to Edit/Change or Delete the Shortcut menu or the Tools bar from the database. I am using MS Access 2016. The file named "Zoom.zip" is located at the http://www.msaccesstips.com/download...-incontrol.php link for Download.

Can anybody help me change the menu or create like that myself? The database contains no such module/vba coding or any macro related to this menu. Thanking in anticipation. Urgent help needed...
Apr 9 '15 #1
Share this Question
Share on Google+
11 Replies


zmbd
Expert Mod 5K+
P: 5,397
need a bit more details...
Apr 17 '15 #2

P: 90
What kind of information may be needed please?
Apr 18 '15 #3

zmbd
Expert Mod 5K+
P: 5,397
+ Version of Office/Access being used in both cases
+ OS
+ What type of shortcut-menu, was it attached to form, the database, right-click, etc...
+ Do you know the name of the menu?
+ Is there any underlying macro or vba script associated with the menu - don't need the code, just if it exists or not?
Apr 18 '15 #4

P: 90
+ MS Access 2013/2016
+ MS Windows 7/10
+ In the form's 'Shortcut menu bar' property, just type the name of the shortcut menu bar as AgrShortcut to apply the shortcut menu bar on mouse right click to the specific form.
+ The name is "AgrShortCut"
+ I tried my best but found no underlying macro or vba script associated with the menu. In the VBA windows I used the Find command in the CurrentProject to find the name but found no such a word.
+ Under the Access's Add-ins tab, a toolbar is visible with the name of AgrMainToolBar.
Apr 17 '16 #5

P: 90
Can I send the mdb access file?
Jun 8 '16 #6

zmbd
Expert Mod 5K+
P: 5,397
[2016-06-09:56UTC::update added a few links]
We typically do not need the data file.

If you are trying to import one of the older style custom menus (mdb files are the older format) in to ACC2013/2016; you may be out of luck as a stand alone tab and/or pop-up as in ACC2003; however, it should be in the "Add-Ins" ribbon tab as you've already discovered, and it does appear that you should be able to add a custom ribbon tab:

Discontinued features and modified functionality in Access 2013 (read more...)

Access 2003 toolbar and menus

You can no longer bypass the Ribbon interface and show Access 2003 toolbars and menus in Access 2013 as you could in 2007 and Access 2010. But you can make them appear on the Add-ins tab, or add them to a custom Ribbon group or the Quick Access Toolbar.

Access 2003 Toolbars and menus are shown in the Add-ins tab on the Ribbon. Adding them to a custom Ribbon group is also supported. You can also use RibbonX and XML to create a custom ribbon for your desktop database.
IMHO, as the versions of office advance, the older style shortcut menus are going to be harder to use... instead you'll eventually have to use the ribbon and context based groups. Unfortunately there's not a lot of information about creating and using Ribbons.

> Simple introduction to the ribbon
Customize the Word Ribbon User Interface
The example here covers Word. The concept for writing the XML for the ribbon is very much the same for Word as in Access; however, in Access the ribbon is quite often built within the Database using a usysribbons table.... so...

> A little more detail:
http://www.accessribbon.de/en/?Welcome
A caution here, this site has its own ribbon creation tool that it sales, AFIK, Bytes.com is neutral about this tool as am I. I include the link to this site because it has one of the best set of reference materials for the Ribbon interface I've ran across since OFFICE2007 introduced the concept - as a matter of fact, if not in part for this site's reference materials, I would never have been able to develop my first Ribbon for Excel when Office2010 first rolled out and broke our custom workbook add-in menus! Mind you, I created that ribbon without their tool. (the tool I did use for Excel is the Custom UI Editor for Microsoft Office - it might still be available; however, any decent XML editor will allow you do the same too and you should be able to add the ribbon schema for the editor to use for validation: Office 2010 Reference: Office Fluent User Interface XML Schema - the Excel files take a little extra work to get the ribbon into, Access is much simpler IMHO).

>>> Take note, an update to the above link, Since Acc2010 it is possible to LATE BIND the ribbon call back; thus, one no longer has to ensure that the interface library (Microsoft Office 1(2|4).0 Object Library) is properly referenced if late binding is implemented. I tend to early bind the ribbon during development and then switch over to late binding once everything is working.

>> This is part one of MS's site Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3) AFIK, 2007 ribbon references are still valid in 2010+; however, that may not hold true in the future
Jun 9 '16 #7

P: 90
Very much thankful to you for this information. The custom menu that I imported into my own accdb file exists under the Add-ins tab. Further, it contains different set of tools/icons than the shortcut menu displayed on right-click on the form, that contains a few options of the Toolsbar present under the Add-ins tab. Now the question is that, how can I remove the toolsbar from the Add-ins menu (and my project/accdb file). Also, can I change the items list in the shortcut menu being displayed on right click in the form?
Waiting for an urgent reply... Thank you an advance.
Jun 10 '16 #8

zmbd
Expert Mod 5K+
P: 5,397
At this point your original question has been answered so if we need to go in to more detail on the following please start a new thread.

To remove the "AgrShortCut" shortcut:
1) Remove any reference to the shortcut menu in your forms
>> THIS IS VERY IMPORTAINT << if you do not do this step the database may crash. I have had this happen in older versions and MS may have fixed the glitch; however, why chance it?

2) <ctrl><g>
2a) Application.Commandbars("AgrShortCut").Delete


To create the shortcut menu:
Create a Shortcut Menu for a Form, Form Control, or Report
>> Note:
Either you must use late binding or the reference to the Microsoft Office 15.0 Object Library (or the current version thereof) must be set to use the examples provided in this link.
For the "late binding" set two constants msoBarPopup = 5 and msoControlButton = 1 both as long, typecast a variable as a undefined object, then set this object to the desired commandbar using I've used simply the application.commandbars._____ where the underscore is the correct call to add the menu or the control as needed (that should make sense when you read the examples). This may not be considered to be true late-binding; however, the reference isn't set and that will help with portability between clients. In development, I would advise the reference be set as the intellisense does make the coding faster and less likely to have syntax errors (and you can compile the code to check for syntax more easily) once ready, you can make the afore mentioned changes.

You should also take a look at this thread:
How to create a custom shortcut menu command that identifies the calling form/report?

You only need to run the VBA code once in the database to create the commandbar for the form.
Jun 10 '16 #9

P: 90
much grateful.
But is it not possible to edit or change the existing one? please
Jun 11 '16 #10

zmbd
Expert Mod 5K+
P: 5,397
But is it not possible to edit or change the existing one?
That's not a very clear question:

+ "AgrShortCut" - as this is appearing in the Add-ins tab, your best bet is to recreate the shortcut menu. For some reason, Access is not treating "AgrShortCut" as a form shortcut menu, why, IDK and I haven't even a good guess for you other than there are often version conflicts.

+ The standard default shortcut menu I would recommend not altering in any way, instead, creating a custom commandbar as shown in my last posting. I find that altering the defaults tends to create other issues down the road that are best avoided.
Jun 11 '16 #11

zmbd
Expert Mod 5K+
P: 5,397
I've merged your two threads given that this is basically the same topic and the second thread provided a bit more information.

From the referenced database it appears to have four custom toolbars
"AgrMainMenu" - this appears to have been intended to be the only menu that would be available upon the database opening based upon the fact that the Employees form opens on database load. As explained earlier, bypassing the ribbon this way has been disabled in Acc2013+

"AgrmReport" - not sure where this commandbar is poping up. It should be part of the Add-Ins ribbon tab; however, not showing there as far as I can tell. Given that this is in the toolbars property of he form Access may be looking for a new style ribbon instead of the old style commandbar for Acc2013+

"AgrShortCut" - this is the shortcut or right-click menu

"Email" - once again, not sure where this commandbar is poping up. It should be part of the Add-Ins ribbon tab; however, not showing there as far as I can tell (same thought about the ribbon/toolbar...)

But was unable to Edit/Change or Delete the Shortcut menu or the Tools bar from the database
To delete the commandbar, use the
Expand|Select|Wrap|Line Numbers
  1. Application.Commandbars("CommandbarNameHere").Delete
as already given.
From the design view of the referenced database, the commandbar in the Add-In tab is "AgrMainMenu"

To edit, we need a bit more information about how you want to edit the custombar and which one.

To create, you need to follow the directions already offered in my prior post about how to create the custom command bars in the newer versions of Access.

> The code attached to the shortcut command bar for the "Zoom" is the VBA Function ZoomOpen() in the Zoom_util module of the referenced database. That was attached to the .OnAction property of the button.

Perhaps a real old-school reference is needed here:
How to create command bars by using Visual Basic code in Access 2000
The examples here show more of the commandbar properties than my first links... of course, ignore the reference to the older MSO-Object library as you would be using the newer version for early binding as mentioned in my prior post.


Please note, we typically do not simply write code unless it's for something very simple or extremely complex for several reasons, one being that we are not sitting in front of your PC; thus unable to customize to your situation and the member will be able to apply their code/knowledge to other situations once they've developed the code for the current situation.
Jun 13 '16 #12

Post your reply

Sign in to post your reply or Sign up for a free account.