How do I programatically create customer Menus, programmatically
disable/enable specific menu items, etc., add/remove menu items, etc.
You don't have to use code to create menus. You can use code to build a
report, or code to build a form, but for the most part, it is FAR FAR easier
to simply use the graphical interface to build a form, or report.
The same applies to building custom menus. For the most part, you don't want
to use code to create the menus, but simply right click on the menu bar..and
can then select customize.
Take a look at the following screen shots of ms-access, and of the menus
were built simply using the mouse..and drag and drop:
http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm
programmatically disable/enable specific menu items, etc., add/remove menu
items, etc.
you can use:
if IsInGroup(CurrentUser,"SuperUser" then
CommandBars("menu bar").
Controls("records").
Controls("refresh").Visible = True
end if
if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then
CommandBars("myCustomBar").
Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True
end if
I wrapped the one above line into 3 for easy reading..but, it should be on
one line. In the above, we are "walking" the menu structure I have, and the
first menu is the main..and then adminOptions would have been a cascade
menu..and inside..we finally reach the DleeteInvoice option which we ONLY
make visible if the user is a member of the InvoiceDeleteGroup.
You also use "enabled" in place of visible to grey out (disable) menu
items....
You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc). Also, using these options means you
do not have to bother setting up security.
Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up. Also note THAT THE menu
bar CHANGES for the different forms....
Check out:
http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm
After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html