Solved

Can't access menu item's shortcut text for custom menu item.

Posted on 2007-04-08
15
314 Views
Last Modified: 2013-11-27
I have a menu bar, everything works great.

But the Shortcut Text is not available for entry. Can I access this? It's available for standard menu items (like Help - F1), but the Shortcut Text field is grayed out for my custom menu items.

One of my items is "Top 10 Issues", with the 1 underlined for hot key. So if you press
Alt, Search Menu, then 1, it queries on the top 10 issues, works great.

Then I have a hidden button with hotkey = 1, so if the user presses Alt-1, the button kicks in, which is the same action as the menu. I just can't access the Shortcut Text field on my "Top 10 Issues" menu option.
0
Comment
Question by:Alaska Cowboy
  • 8
  • 5
  • 2
15 Comments
 
LVL 38

Assisted Solution

by:puppydogbuddy
puppydogbuddy earned 75 total points
ID: 18872773
HI Bill,
If you use the Access Startup Property configurator, your problem could be related to the settings theron.....Go to   Tools>Startup Properties>>> then you'll see 4 settings for menubars and toolbars, including settings to allow changes to menubars and toolbars.

If your problem is not related to the above, then it is easier answered by linking you to a tutorial about creating custom menubars and toolbars:

                           http://www.jamiessoftware.tk/articles/menubars.html

The first half of the tutorial deals with creating Custom menubars and the last part of the tutorial dealing with popup menus relates to the shortcut menus.

Hope this helps.  At least, after reviewing the tutorial and you still have a problem, you will be able to point to  a  specific exhibit to provide more details of your problem.  
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18872918
PDB, thanks for the tip. I forgot about the Startup Properties, but it is checked (yes) to allow changes to menus and toolbars. I'll have a look at Jamie's site.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18872930
PDB, in Jamie's tutorial, the Shortcut Text field is also grayed out . . . so maybe you can't get to it for custom menu items.

btw, I completely revised the look of my application, with a custom menu and toolbar(s) being one of the main revisions (and easy to do . . .)
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18872955
Bill,
You are really putting in all the bells and whistles....and I bet it has been exciting every step of the way!

Getting back to your problem at hand.  Which exhibit are you referring to in Jamie's tutorial.  If you look at Figure 15, where the shortcut menubar is selected, you should be able to look at (and change) the properties.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18875221
<Shortcut Text field is grayed out for my custom menu items>
I've not spent much time on this but I have never been able to set this on my custom menu items either.

Steve
0
 
LVL 39

Accepted Solution

by:
stevbe earned 125 total points
ID: 18875244
OK ... I was just playing a bit more and while you can not get to it through the UI you can set it in code and even after you do that it does not appear while you are in customize mode but it does displaty properly when the app is running.

Application.CommandBars("BJs Data Menu").Controls.Item("Administration").Controls.Item(1).ShortcutText ="LLL"
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18875566
PDB, Figure 9 "ShortCut Text" is grayed out.

Yes, I'm had a lot of fun fixing the app. Mostly it's been the UI and installation procedures. I picked up Inno Setup and that is fantastic. I'll be sending it back to you around the end of May for another look.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18875929
Steve,

Thanks for checking this out.

I added your code but it doesn't seem to work.

It compiles successfully but the ShortCut text doesn't show up when running the app.

I put this in my startup form:
    'To set the Shortcut Text for menu items
    Application.CommandBars("Info Manager").Controls.Item("Top &10 Items Only").Controls.Item(1).ShortcutText = "Ctrl + 1"
    Application.CommandBars("Info Manager").Controls.Item("&Show Search Fields").Controls.Item(1).ShortcutText = "Ctrl + 8"
    Application.CommandBars("Info Manager").Controls.Item("&New List").Controls.Item(1).ShortcutText = "Alt + J"

No shortcut text shows up . . .

I then put the code in the form_load event of the one form that uses this menu - Access choked on it.

Bill
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18875967
I also tried it without the & (just to be sure), but still nothing shows up.

this is pretty low priority, so no need for any extensive research or testing.

Thanks.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18877319
I did not test it while the app was running, I only opened the database in design mode and ran the code from the immediate window.

Steve
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18877711
Ok, don't worry about it. Thanks for checking back.
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18877762
<I only opened the database  ...> but the setting was there the next time I opened the app so you only need to do this once during design.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18886419
Steve, thanks again. I'd still like to replicate what you have done, but not able to do so.

(I never use the Immediate Window, never had it explained to me)

but anyway,
- My app is running
- I copied to the immediate window: Application.CommandBars("Info Manager").Controls.Item("Top 10 Items Only").Controls.Item(1).ShortcutText = "Ctrl + 1"
, then pressed Enter.

it said "Run=time error '5': Invalid procedure call or argument.

It compiles fine and when I de-bug it, it just goes its merry way past the statement without batting an eye - but not Shortcut text :-(
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18892215
not sure if this is your issue but  ... I displayed my custom menu before I executed the code.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 18897598
still not working, but thanks for checking back. It's really minor so I'll just keep it on my enhancements list . . .
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now