none
Trouble with shortcut menus in Access 2010

    Question

  • I am having a problem with two custom shortcut menus in my Access 2010 database.  I first created a shortcut menu with 5 commands and set it as the shortcut menu for one of my forms, which worked fine.  Then, I re-ran the code to add 4 more commands to the menu, which also worked fine.  However, when I closed and re-opened my database, only the 5 original commands appeared in my menu.  I deleted all the commands from the menu and deleted the menu itself, then started over from scratch using this code:

    ============================

    Sub AddDALMenu()
    Dim cmbShortcutMenu As Office.CommandBar
    Dim cbb As CommandBarButton
        Set cmbShortcutMenu = CommandBars("DALMenu")
        With cmbShortcutMenu
            ' Start a new grouping and add the Sort Ascending command.
            .Controls.Add(msoControlButton, 210, , , True).BeginGroup = True
            ' Add the Sort Descending command.
            .Controls.Add msoControlButton, 211, , , True
            ' Start a new grouping and add the Remove Filer/Sort command.
            .Controls.Add(msoControlButton, 605, , , True).BeginGroup = True
            ' Add the Filter by Selection command.
            .Controls.Add msoControlButton, 640, , , True
            ' Add the Copy command
            .Controls.Add msoControlButton, 19, , , True
            ' Add the command to email the record
            Set cbb = .Controls.Add(Type:=msoControlButton)
            With cbb
                .Style = msoButtonIconAndCaption
                .FaceId = 2188
                .Caption = "Send by email"
                .OnAction = "macSend"
            End With
            ' Add the command to link subjects to the record
            Set cbb = .Controls.Add(Type:=msoControlButton)
            With cbb
                .Style = msoButtonIconAndCaption
                .FaceId = 2141
                .Caption = "Link people to this Incident"
                .OnAction = "macSubject"
            End With
            ' Add the command to link vehicles to the record
            Set cbb = .Controls.Add(Type:=msoControlButton)
            With cbb
                .Style = msoButtonIconAndCaption
                .FaceId = 0
                .Caption = "Link vehicles to this Incident"
                .OnAction = "macVehicles"
            End With
            ' Add the command to link files to the record
            Set cbb = .Controls.Add(Type:=msoControlButton)
            With cbb
                .Style = msoButtonIconAndCaption
                .FaceId = 279
                .Caption = "Link files to this Incident"
                .OnAction = "macFiles"
            End With
            ' Add the command to link incidents together
            Set cbb = .Controls.Add(Type:=msoControlButton)
            With cbb
                .Style = msoButtonIconAndCaption
                .FaceId = 522
                .Caption = "Link Incidents together"
                .OnAction = "macLinks"
            End With
        End With
        Set cbb = Nothing
        Set cmbShortcutMenu = Nothing
    End Sub

    ===========================

    Running this code created my menu with all the commands, and worked fine.  But again, once I closed and re-opened the database my menu reverted to just the five original commands.

    Can anyone help me figure this out?

    Monday, August 26, 2013 9:48 PM

All replies

  • Hi Michael, 

    I'm trying to involve the senior engineers into this issue but it will take some time. Your patience will be greatly appreciated. We will let you know if any progress is made.

    Sorry for any inconvenience.


    Sophia Gou <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> MSDN Community Support Please remember to "Mark as Answer" the responses that resolved your issue.

    Wednesday, August 28, 2013 12:04 PM
    Moderator
  • Take a look at this video, it might be helpful.  It was for me.

    http://www.youtube.com/watch?v=G0OetcYcbM8

    I bought the file in the video for $1.35  - just for the addin tab that contains FaceId Icons and their corresponding number.


    If this post answered or helped you find the answer to your question, please mark it as such for other Forum users knowledge.



    • Edited by h2fcell Wednesday, August 28, 2013 4:00 PM
    Wednesday, August 28, 2013 3:45 PM
  • Thank you h2fcell.... I looked all over for a reliable source for faceIDs!  Definitely sounds like it's worth $1.35.
    Wednesday, August 28, 2013 5:40 PM
  • Thank you Sophia.  I forgot to mention the second problem I experienced, which was that I had created a second shortcut menu for another form, and upon exiting and reopening the database that menu had disappeared entirely.  I used similar code to create the second menu, and all the commands in the menu were built-in commands such as Copy, Paste, Spelling, etc.
    Wednesday, August 28, 2013 5:41 PM