masoud_sedighy
Registered User.
- Local time
- Today, 13:17
- Joined
- Dec 10, 2011
- Messages
- 132
Before I have a question about how I can have a shortcut option when right click on each item on the list box.
So I got my answer with below code that opens another form "frmshortcut" with a listbox inside that shows list of options like "new task" , "edit item" .
Now my problem is (like attached picture) the shortcut list (frmshortcut) will be open in another place when I right click the mouse, it is far from location of click.
Also it shows some default in access when I right click in the listbox ("subform", "cut", "copy"), actually I do not like it shows these, just I like it shows shortcut list I have defined by the list box.
Private Sub ItemList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Const RIGHTBUTTON = 2
[FONT="][/FONT]
If Button = RIGHTBUTTON Then
DoCmd.OpenForm "frmshortcut"
' DoCmd.OpenForm "frmshortcut", acNormal, , , , acDialog
Forms!frmshortcut!txtparameter = Me.ItemList.Value
End If
End Sub