hiding items on a popup menu

L

L Melville

Hi,

I have a popup menu I use on some forms, but not all forms require all the
selections on the popup menu, is it possible to hide specific items when
calling the popup menu? If it is not possible to hide them, then what about
making them un-selectable?

thanks in advance
lee
 
R

Rick B

Just change the query or filter that the list is based on.


Hi,

I have a popup menu I use on some forms, but not all forms require all the
selections on the popup menu, is it possible to hide specific items when
calling the popup menu? If it is not possible to hide them, then what about
making them un-selectable?

thanks in advance
lee
 
A

Albert D. Kallal

I would actually make a copy of the custom menu bar, and then specify that
correct menu for the form with the options already removed.

The reason for this is that if the user switches to another form that DOES
need some of those options..you are faced with writing a lot of spaghetti
code..and trying to figure out when a user switches between forms..and then
somehow hide/un-hide those options. How are you going to control which
options are highlighted when you switch back and forth between two forms
opened that use the same shortcut? So, I don't recommend you do this at all.
If you give each form its own menu.then you don't need any code at all.

However, if you are sure that other forms that need the menu will NEVER be
opened..then you can simply hide options.

You can use the commandbars colleciton

CommandBars("myCustomBar").Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True


The above of course would be on one line..but is wrapped for this message.

So, in your case:

commandbars("yourShortCuMenu").Controls("MyDelete").visible = false

You can also use enabled..so you will still see the option...but it will be
greyed out:

commandbars("yourShortCuMenu").Controls("MyDelete").Enabled = false
 

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