Form Shortcut Menu Bar property

D

darkforcesjedi

In a form I put "=ShowFormPopup('FORM_NAME')" for the "Shortcut Menu
Bar" property. ShowFormPopup is a function that customizes a shortcut
menu I created based on the calling form.

This has some problems. I added items to my shortcut menu to change the
view of my form from the "View Menu". When I try to change to Datasheet
view it says it can't change the view because code is executing. Also
it displays a new blank menu after the ShowPopup method completes for
my custom menu.

How do I get a "context-sensitive" menu that applies to the whole form?


example:

Public Function ShowFormPopup()

Dim mnu As CommandBar
Dim ctl As CommandBarControl
Set mnu = CommandBars("FormPopup")

For Each ctl In mnu.Controls
ctl.Visible = ctl.Enabled
Next

mnu.ShowPopup

End Function
 
R

Rick Brandt

darkforcesjedi said:
In a form I put "=ShowFormPopup('FORM_NAME')" for the "Shortcut Menu
Bar" property. ShowFormPopup is a function that customizes a shortcut
menu I created based on the calling form.

That property is expecting just the name of your shortcut menu, not a function.
 
A

Albert D. Kallal

The shortcut menu setting in the "other tab" in the forms property sheet is
designed for this. You really don't need to write one line of code here to
do this...

If you set the above, then a right click (shortcut) menu will be available
for the whole form...and you will not have written any code to accomplish
this...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top