Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing Context Menu's

Status
Not open for further replies.

SiJP

Programmer
May 8, 2002
708
GB
I have an interesting situation which I need some views on.

One of my forms has a context menu (right click sub menu, if you must) that i've defined in the forms properties (Form.ShortcutMenuBar). We'll call this 'Shortcut_1'.

Whenever a right-click is detected on the form, the context menu Shortcut_1 appears which is great.

Now, I also have another context menu called Shortcut_2 which I want to appear only when a right-click is detected in one particular field.

I've done this by using the MouseUp event of the field, and checking the integer value of the Button argument is 2. I can then using the Application.Commandbars("Shortcut_2").ShowPopup call.

This works perfectly.. almost. As soon as the MouseUp event is finished (after showing the Shortbut_2 menu), Access realises that a right-click has occured, and shows the Shortcut_1 context menu.

How can I stop Access displaying the Shortcut_1 menu? Can this be suppressed with an event that fires after the MouseUp event is called?

Thanks

------------------------
Hit any User to continue
 
Never mind.. it was an easy one to find out..


Just placed Docmd.CancelEvent after I'd run my mouse up code...


:D

------------------------
Hit any User to continue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top