Results 1 to 3 of 3

Thread: Shortcut Menus

  1. #1
    Join Date
    Jan 2004
    Location
    California, USA
    Posts
    25

    Unanswered: Shortcut Menus

    I need to be able to activate a Shortcut Menu within a form by using either VB Code or a macro. Can someone show me how to do this?

    Thanks much,
    PC

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    1) Create your shortcut menu.
    2) In the OnOpen event of your form enter the following code:

    Me.ShortcutMenu = True
    Me.ShortcutMenuBar = "myShortCutMenuName"


    When you right-click the mouse, the menu will pop up.
    You can do this with specific controls (like a TextBox) as well.



  3. #3
    Join Date
    Jan 2004
    Location
    California, USA
    Posts
    25
    This may be more complicated that I first mentioned. I will be using one custom shortcut menu for my form and on the form is a Richtext Box named "NotePad" onwhich I need to use another custom shortcut menu. The event code that I will be using to activate the shortcut menu in the Richtext Box is:
    ________________________________________________
    Private Sub NotePad_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
    If Button = acRightButton And Shift = vbNormal Then
    'Do your right-click stuff here

    Me.ShortcutMenu = "true"
    Me.ShortcutMenuBar = "rtfMenu"

    End If
    End Sub
    ________________________________________________
    Unfortunately the commands you gave me for this don't seem to work. There must be some other command that will work.

    The name of my shortcut menu is "rftMenu" so that I can identify it from the other shortcut menus that I have. To elaborate; the form has a tab control onwhich there are a number of tabs. Each tab has different controls (ie. text boxes, memo fields, and richtext boxes). The database is for tracking some state regulations; so in order to maintain the crossouts, underlines, bolds and italized text I need to use rich text. The other memo fields don't need formatting, so they are left for unformatted text. For the fields using unformatted text, I use shortcut menu named "frmMenu" and likewise for my report print preview screen I use a shortcut menu named "rptMenu".

    The problem developed from the properties of the richtext fields require different editing commands from the unformatted text and the richtext fields don't seem to allow for another right click popup menu like a shortcut menu. I tried using a popup "menu" form for the richtext field; however, I don't know how to connect the commands from a popup form to the form being edited. Thus I'm made an additional shortcut menu and I'm looking for a way to exicute it differently from the shortcut menu already assinged to the rest of the form. On the tab control pages I have different richtext fields; so I've made a module with Public Functions to apply to any richtext active control.

    The method suggested is appreciated by all means; however, it doesn't work for my design. I need an alternate method to activate this shortcut menu, like using a macro or a "DoCmd" type of code in VB. In otherwords, is there a way to have more than one shortcut menus for the same form?

    Thanks for your reply,
    PC

Posting Permissions

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