?
Solved

Custom short cut menu

Posted on 2014-02-06
6
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 85
ID: 39840726
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
ID: 39895984
I am using 2007.  Thanks for your help.
0
 
LVL 85
ID: 39897039
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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 75
ID: 39897570
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
ID: 39898829
Can you show me what the vba code would look like?  I use code instead of macros. Thanks!
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 39899071
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Suggested Courses

777 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