UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Alt "hotkey" On Top Level Menu, Access 2016    
 
   
tohas
post Mar 29 2020, 09:53 AM
Post#1



Posts: 93
Joined: 9-July 10



Hello,

I have a migrated mdb with a lot of commandbars running.

Ribbons are not an option for me.


Q:
How can I get the Hotkey "&Run2" -> ALT+R working on TOP LEVEL Menu ?


CODE
Sub BuildMenu()
    Dim cb As CommandBar, cpop As CommandBarPopup, cbtn As CommandBarButton
    ' Get the menu bar (CommandBar).
    Set cb = Application.CommandBars(cMenueBar01)        
    ' Add top-level menu item (CommandBarPopup).
    Set cpop = cb.Controls.Add(msoControlPopup, , , , True)
    cpop.Caption = "&Run2"
    ' The Tag property makes it easy to delete this menu later.
    cpop.Tag = "Run2"
    ' Add items to the menu (CommandBarButton).
    Set cbtn = cpop.Controls.Add(msoControlButton, , , , True)
    ' Set menu item properties.
    cbtn.Caption = "Sample &1"
    cbtn.OnAction = "Sample1"
    ' Add a second item.
    Set cbtn = cpop.Controls.Add(msoControlButton, , , , True)
    cbtn.Caption = "Sample &2"
    cbtn.OnAction = "Sample2"
    ' Add a third item.
    Set cbtn = cpop.Controls.Add(msoControlButton, , , , True)
    cbtn.Caption = "Run &All"
    cbtn.ShortcutText = "Ctrl+Shift+A"
    cbtn.OnAction = "TestMenus"
    ' Add a separator bar before this item.
    cbtn.BeginGroup = True
End Sub



Thanks
This post has been edited by tohas: Mar 29 2020, 09:54 AM
Go to the top of the page
 
DanielPineault
post Mar 29 2020, 10:55 AM
Post#2


UtterAccess VIP
Posts: 7,336
Joined: 30-June 11



What do you mean by "TOP LEVEL Menu"?

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
theDBguy
post Mar 29 2020, 11:22 AM
Post#3


UA Moderator
Posts: 78,090
Joined: 19-June 07
From: SunnySandyEggo


Hi. You could try using Autokeys.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
HiTechCoach
post Mar 29 2020, 04:13 PM
Post#4


UtterAccess VIP
Posts: 19,037
Joined: 29-September 03
From: Oklahoma City, Oklahoma


tohas,

Are using the commandbar collection to create the old menubar that was used with Access 2003 and older versions?

Are you seeing an "ADD-IN" tab on the far right side of the ribbon that has your menubar?

AFAIK, you press the alt key then the letter on the ADD-IN tab. the key for the letter of the option on your commandbar. This is how ti works with al the Access Applications that I have migrated from Access 2003 and older with menubars.

I would try theDBguy's suggestion for the autokey macro if you want the key combination of ALT+r.









--------------------
Boyd Trimmell aka Hi Tech Coach ( HiTechCoach.com free Access stuff)
Microsoft MVP 2010-2015 - Access Expert
Inventory Control, Accounting, BPM, and CRM Software Developer
"If technology doesn't work for people, then it doesn't work."
Go to the top of the page
 
tohas
post Mar 30 2020, 02:58 AM
Post#5



Posts: 93
Joined: 9-July 10



@all

Acc2016 with acc 2000 mdb commandbars.

I don't see the addin tab, because I renamed this tab via USysRibbons.
But it is to much effort to convert all old menus commandbars into ribbons.

A top level menu is a such as File or View or Tools.
A picture to show what I mean: "Format" is the TOP

https://deutschedownloads.de/upload/screenshot1570.jpg

All my sub level menus have the hotkeys (sub level menu == menue buttons below the top level)
but the top level don't have a underlined char for hotkey.

I know the ALT Trick but It shows only the Ribbon tabs.
This post has been edited by tohas: Mar 30 2020, 02:58 AM
Go to the top of the page
 
HiTechCoach
post Mar 30 2020, 11:39 PM
Post#6


UtterAccess VIP
Posts: 19,037
Joined: 29-September 03
From: Oklahoma City, Oklahoma


It has been my experience migrating from Access 2.0/95/972000/2002/2003 with the custom menubars that Access 2007/2010 played well with the old-style menubars for backward compatibility.

By Acess 2013 the menubars had less backward compatibility with menubars. Access 2016 even less backward compatibility.

Since Access 2013, I have migrated to the Ribbon. IT made the runtime mode much better.

If you want to stick with the old menubars then you will probably want to stick with Acess 2007 or 2010 and avoid 2016 and later.

FWIW: I found that converting front end from MDB to an accdb made it play better with Access 2010 and later. I also found the opening the front end in runtime mode made the menubar work better and I did not have to do anything to hide the default ribbon.

You might find this helpful: CommandBars Converter

--------------------
Boyd Trimmell aka Hi Tech Coach ( HiTechCoach.com free Access stuff)
Microsoft MVP 2010-2015 - Access Expert
Inventory Control, Accounting, BPM, and CRM Software Developer
"If technology doesn't work for people, then it doesn't work."
Go to the top of the page
 
isladogs
post Mar 31 2020, 04:39 AM
Post#7


UtterAccess VIP
Posts: 2,308
Joined: 4-June 18
From: Somerset, UK


Just for info, whilst using an Autokeys macro would allow you to assign a keyboard shortcut, you cannot use ALT as part of that macro.
However both CTRL and SHIFT can be used in combination with various letters

I would also suggest moving over to ribbons. Whilst more complex to setup they work more smoothly with newer versions of Access

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
tohas
post Apr 1 2020, 04:05 AM
Post#8



Posts: 93
Joined: 9-July 10



thanks for link: CommandBars Converter

have you tried this tool with success?

Go to the top of the page
 
HiTechCoach
post Apr 1 2020, 07:06 PM
Post#9


UtterAccess VIP
Posts: 19,037
Joined: 29-September 03
From: Oklahoma City, Oklahoma


The Commandbar converter does work.

Note: It does require a RibbonCreator purchased license which you will want to continue working with Ribbons.

--------------------
Boyd Trimmell aka Hi Tech Coach ( HiTechCoach.com free Access stuff)
Microsoft MVP 2010-2015 - Access Expert
Inventory Control, Accounting, BPM, and CRM Software Developer
"If technology doesn't work for people, then it doesn't work."
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    24th May 2020 - 11:30 PM