Thanks for all reply.
Menuitems don't have a name at runtime?! My god. It is a must that I need to
disable some menuitem during run-time. My approach is "My application got
one menu bar , every user got its security tables, he/she got different
permission in each forms. e.g Invoicing , user A allows to use invoice, but
not user B'
As userB Login the application, i need to disable the 'Invoice menu' .
HOWEVER, I can't use the menuitem.text becauese the menu item will be
displayed in GB or B5, or English.
May be I need to change my security design....
From AGnes
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> ¦b¶l¥ó
news:ev*************@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
Agnes,
As Imran suggests.
MenuItem is an object, however it is NOT a control.
Your form has both a Menu property that is the main menu, and a
ContextMenu (inherited from Control) that is used for context menus.
You need to use the MenuItems collection of the respective menu.
I need to Me.mnuXXX.Enabled = false during run-time
Anyone know how can do that ??
Have you tried?
Me.mnuXXX.Enabled = False
Or are you wanting to dynamically set a menu.Enabled to false based on a
string? Remember MenuItems don't have names exposed at runtime (they are
compile time only).
Hope this helps
Jay
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... dim c as controls
for each c in me.controls
messagebox.show(c.name)
next c
I found that the menu time didn't show up ?? It didn't belongs to the
control in the form ???
I need to Me.mnuXXX.Enabled = false during run-time
Anyone know how can do that ??