Solved

Custom short cut menu

Posted on 2014-02-06
6
296 Views
Last Modified: 2014-04-22
I have a maximized form that is in a databsheet view.  I want the user to be able to close the form because the tabs are not showing. How can I make it so that if the user clicks on the right mouse button there is only one option: Close?  Thanks.
0
Comment
Question by:Sasha42
  • 3
  • 2
6 Comments
 
LVL 84
Comment Utility
What version of Access are you using? Versions before 2007 made it quite simple to create a right-click menu, but 2007 or newer is quite different.
0
 

Author Comment

by:Sasha42
Comment Utility
I am using 2007.  Thanks for your help.
0
 
LVL 84
Comment Utility
Essentially you create a custom macro group that includes the commands you want the user to see, and then you "call" that macro in the Form's "Shortcut Menu" property. This will supplant the default Access right click menu, and you can include only those items you want the user to see.

See this article for more information:

http://office.microsoft.com/en-us/access-help/create-custom-menus-and-shortcut-menus-by-using-macros-HA010282509.aspx
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
fwiw ... a new tool (Access Add In) is being developed as we speak that will replace the <=A2003 Customize Dialog. It will allow creating new commandbars (menus & right click  menus) as well as edit existing commandbars. It will also have several features not present in the original Customize Dialog, including importing selected commandbar elements from other dbs.

No coding will be required ...

mx
0
 

Author Comment

by:Sasha42
Comment Utility
Can you show me what the vba code would look like?  I use code instead of macros. Thanks!
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
Essentially you do this:

strCBarName = "MyNewPopupMenu"
Set cbrCmdBar = Application.CommandBars _
   .Add(Name:=strCBarName, Position:=msoBarPopup)

From here: http://msdn.microsoft.com/en-us/library/office/aa140930(v=office.10).aspx

Once you do that, you can then set the form's Shortcut menu to whatever you've named the popup.

Obviously you'd want to add items to that. The article here shows how to do that:

http://msdn.microsoft.com/en-us/library/office/aa163587(v=office.10).aspx

Note too the links on those pages in the "See Also" section - there are a LOT of links that show how to do various things with commandbars.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

763 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

6 Experts available now in Live!

Get 1:1 Help Now