I would like to open a from when i right click on text box. The same way when you right click on windows desktop. I'm stuck @ the moment on this not knowing which way to go.
Regards
Jim.
The solution provided by CaptainRon does work, but it also opens the form when the left button is clicked. I also encountered the shortcut menu opening with grayed if I ran the right click event two times in succession. So you might consider using the following code which disables the Form's shortcut menu when the right mouse button is clicked and opens the form in Dialog mode, then uses the Detail's MouseMove event to turn the shortcut menu back on.
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.ShortcutMenu = True
End Sub
Private Sub TextBoxName_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = acRightButton Then
Me.ShortcutMenu = False
DoCmd.OpenForm "FormName", , , , , acDialog
End If
End Sub
In Access go to "View" - "Toolbars" - "Custom" create a menu and name it what ever. Go to it's properties and make it a "PopUp" and it will add it to your Shortcut menus.
Now go to "View" - "Toolbars" - "Shortcut Menu bar" a menu bar will appear and on the right you will see "Custom" select that and you should see your newly created Popup, now add macros, menu items etc. (What ever you want)
Now select the text box or what ever you want the popup to attach to, go to its "Properties" select "Shortcut Menu Bar" choose your new menu and you are off and running.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.