Drop-down menus and how to grey-out items

G

Guest

A system I'm working on has drop-down menus controlled by macros. Under
certain conditions, I need to gray out two options on one drop-down. Does
anyone know how to do this? I have never used drop-down menus before. This is
a 2.0 system converted to 97 and now converted to 2000 so it has a lot of
old-style code in it.
Thanks - David
 
A

Albert D.Kallal

Hum, I don't know about controlling the menus with macros.

I use a lot of custom menus in ms-access. They are easy to build with the
mouse and "drag and drop". So, no code is needed to build the menus (but,
for sure, most of my menu buttons do call code - by moving your buttons from
a from to a menu bar, you can substantially reduce clutter, and those menu
bars can still call the code in the form that the old buttons previously
called).

So, I can't comment on macros, as I don't use them. However, for code, you
can most certainly enable, or even hide menu buttons.

Here is a example code that is a user is a member of the
"InvoiceDeleteGroup" security group, then I enable a menu

if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then


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

end if

The above is wrapped for ease of read (and would be on one line)

Note that short cut menus are their own name also:

commandbars("your shortcut name").Contorls("contorlName").visiable = false


You can see a bunch of sample menus screenshots here:
http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm
(the above is also a good read as to why menus are so user friendly).
 

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