I've been doing it via code (as Graham mentioned) for several years now.
Take a look at the commandbars class to get an idea of the type of controls
you can use. The following is a sample of my textbox shortcut menu. I
generally call this routine when my application opens, to build the
MyTextMenu shortcut menu. Then, I either set the ShortCutMenu property to
MyTextMenu, or in those instances where I want to disable the forms shortcut
menu, I'll put a line of code in the MouseDown event of the textbox controls:
Private Sub txt_LD_Concept_MouseDown(Button As Integer, _
Shift As
Integer, _
X As Single, Y
As Single)
If Button = acRightButton Then CommandBars("MyTextMenu").ShowPopup
End Sub
If you set a reference to the Microsoft Office xx.0 Object Library, you will
get the intellisense and can actually declare your variable as commandbars,
buttons, ...
But when I am done, I ususally remove that reference and change the
declarations to Object, so the app will work with different versions of
Office and will not throw an error related to the referenced object library.
Once you've created this, all you need to do is follow it up with the actual
functions that are used in the .OnAction property of the control.
Public Sub TextMenu()
Dim cbr As Object
Dim cbrButton As Object
On Error GoTo TextMenuError
DoCmd.Hourglass True
Set cbr = CommandBars.Add("MyTextMenu", BarPopup, , True)
With cbr
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.Caption = "&Copy"
.Tag = "Copy"
.OnAction = "=fnTextCopy()"
End With
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.Caption = "&Paste"
.Tag = "Paste"
.OnAction = "=fnTextPaste()"
End With
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.begingroup = True
.Caption = "&Spell check"
.Tag = "Spell check"
.OnAction = "=fnTextSpell()"
End With
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.begingroup = True
.Caption = "&Find"
.Tag = "Find"
.OnAction = "=fnTextFind()"
End With
End With
DoCmd.Hourglass False
Exit Sub
TextMenuError:
MsgBox Err.Number & vbCrLf & Err.Description, vbInformation + vbOKOnly,
"TextMenu error:"
End Sub
--
HTH
Dale
email address is invalid
Please reply to newsgroup only.