Results 1 to 2 of 2
  1. #1
    ludovic_44 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Location
    mauritius
    Posts
    15

    HOW TO CREATE A SHORTCUT MENU FOR FORM IN ACCESS (copy,cut,paste and delete)

    Dear All,

    I have some VBA code which i found on the net to create a shortcut menus on form when right-click on form
    but i really dont know what is the steps to proceed to have this shortcut as right-click

    Shall i paste below these code on a module or on the form load
    Can you please tell me how do i proceed please, whats the step and how to put the shortcut menu on the forms properties

    Please i really need how to proceed

    Thanking you in advance for your kindness


    Sub CreateSimpleShortcutMenu()
    Dim cmbShortcutMenu As Office.CommandBar

    ' Create a shortcut menu named "SimpleShortcutMenu.
    Set cmbShortcutMenu = CommandBars.Add("SimpleShortcutMenu", msoBarPopup, False, True)



    ' Add the Remove Filter/Sort command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=19

    ' Add the Filter By Selection command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=21

    ' Add the paste By Selection command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=22

    ' Add the delete By Selection command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=478

    Set cmbShortcutMenu = Nothing

    End Sub



  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Looks like code came from http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

    which says:
    Once you've run the code, the shortcut menu is saved as part of the database. You don't have to run the same code to re-create the shortcut menu every time that you open the database.

    So I suggest you put the code in a general module, then run the procedure with Run command from the VBA menu bar.

    Then follow instruction:
    To assign the shortcut menu to a form, form control, or report, set the Shortcut Menu property of the object to Yes and set the Shortcut Menu Bar property of the object to the name of the shortcut menu. For this example, set the Shortcut Menu Bar property to SimpleShortcutMenu.

    You will find those properties on the Other tab of Property Sheet.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-08-2014, 02:06 PM
  2. Unable to create shortcut menu
    By lawdy in forum Programming
    Replies: 36
    Last Post: 05-25-2014, 10:36 AM
  3. Copy and Paste in right click menu
    By chriscardwell06 in forum Access
    Replies: 1
    Last Post: 12-27-2013, 09:15 AM
  4. Copy Paste the entire MS Access Database
    By mkc80 in forum Access
    Replies: 6
    Last Post: 08-24-2012, 01:07 PM
  5. Copy paste from CSV to Access 2010
    By mschmucker in forum Access
    Replies: 1
    Last Post: 12-16-2011, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums