Avatar of Henry Vandersteen
Henry Vandersteen
Flag for Afghanistan asked on

ShortCut menu problem in datasheet - Access 2010

Hi all

This problem has persisted from Access 2003 to Access 2010

I have a custom shortcut menu that I assigned to the Shortcut Menu Bar of a subform object that is displayed in datasheet view on another form
The correct shortcut menu is shown when the user right clicks on a cell in the datasheet.  However, if the user right clicks on the heading of a column or selects an
entire column of the subform, the standard shortcut menu is shown.

How do I override the standard shortcut menu that is shown when you right click on a
column heading or selects the entire column in datasheet mode on my subform

I only want my custom shortcut menu to appear when the user right clicks ANYWHERE on the subform

Thanks
H
Microsoft Access

Avatar of undefined
Last Comment
Dale Fye

8/22/2022 - Mon
Dale Fye

You cannot, to the best of my knowledge, disable the any of the datasheets various shortcut menus and still implement your custom menu.

However, you could hide all of the menuitems associated with each of those menus, and add your own  menu items to those commandbars.  Did you create your custom shortcut menu using VBA, or the old 2003 Customize dialog box?
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

I agree in that I've never been able to find a way to hide the Right Click menu you speak of.
I suspect however, that I could be deleted from the CommandBars collection - which for me would not be a big deal since I have no use for that menu. Actually, you may be able to Hide and/or Disable this menu.

You can used Steven Leban's CommandBars tool to display ALL CommandBars in a given db

http://www.lebans.com/commandbars.htm

mx
Henry Vandersteen

ASKER
Hi fyed and DatabaseMX

Thanks for both your replies.

Yes did create my shortcut menu using VBA in Access 2010

I'll look into your comments and Lebans website and get back to you

H
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Dale Fye

I've got some other code that will help you identify which built-in shortcuts you need to look at, and some code that will hide/reveal (.visible = true/false)  all of the items in one of the standard commandbars.  Unfortunately, I cannot get to it at the moment.

BTW, you can add items to those standard commandbars at runtime, so you could simply change the code you used to create your commandbar, point it to the standard command bar and add your own controls.

In the datasheets where I do that, I use some code in the forms OPEN event to hide the standard shortcut items and reveal mine.  Then, in the Form_Close event, I reverse that process and hide my items and reveal the original items.
Henry Vandersteen

ASKER
HI fyed

I would appreciate your code on how to hide/reveal the items in the standard shortcut menu, whenever you get the chance

Thanks
H
ASKER CERTIFIED SOLUTION
Dale Fye

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Henry Vandersteen

ASKER
Thank you
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Dale Fye

Glad I could help.

Here is the article I mentioned above.  With some sample code in the article and a database attached with additional code.