Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2014
    Posts
    3

    Unanswered: Custom Shortcut Menu

    This is the code I have put together so far. I'm trying to create a custom right click menu. I want to add the "Text Filters" dropdown to this menu and am looking for a little help. If you were viewing a datasheet and using the default shortcut menus you would see the "Text Filters" option in you right clicked. I'm looking to add that to my menu. Any help at all would be GREATLY appreciated!! I'm using access 2010. Thanks!

    Sub CreateWIPShortcutMenu()
    Dim cmbRightClick As Office.CommandBar

    ' Create the shortcut menu.
    Set cmbRightClick = CommandBars.Add("cmdWIP", msoBarPopup, False, True)

    With cmbRightClick
    .Controls.Add msoControlButton, 19, , , True 'Copy

    .Controls.Add msoControlButton, 141, , , True 'Find

    .Controls.Add(msoControlButton, 210, , , True).BeginGroup = True 'New group and Ascending

    .Controls.Add msoControlButton, 211, , , True 'Decending

    .Controls.Add(msoControlButton, 10068, , , True).BeginGroup = True 'New group and Equals selection

    .Controls.Add msoControlButton, 10071, , , True 'Filter Excluding selection

    .Controls.Add msoControlButton, 10076, , , True 'Contains Selection

    .Controls.Add msoControlButton, 10089, , , True 'Does not contain selection

    .Controls.Add msoControlButton, 10090, , , True 'Begins With selection

    .Controls.Add msoControlButton, 12265, , , True 'Does not begin with selection

    .Controls.Add msoControlButton, 10091, , , True 'Ends with selection

    .Controls.Add msoControlButton, 12266, , , True 'Does not end with selection

    .Controls.Add msoControlButton, 605, , , True 'Remove Filter/Sort

    End With

    Set cmbRightClick = Nothing

    End Sub

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    What problem did you encounter with the code you posted?
    Have a nice day!

  3. #3
    Join Date
    Jun 2014
    Posts
    3
    This code works fine. I'm trying to add to this shortcut menu the option "Text Filters". This is a combobox that provides the user the ability to choose several options like "Equals", "Does Not Equal", "Begins With" etc. I don't know the button IDs and am not sure how to go about adding a combobox to this menu.

  4. #4
    Join Date
    Jun 2014
    Posts
    3
    Okay, maybe I can sneak up on this instead since it looks like there are no answers. Can someone tell me what that "Text Filters" is on that shortcut menu? Is it a dropdown? A ComboBox? If it is one of these how would I go about incorporating it into my menu above? Any help at all would be appreciated! Thanks!

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •