Rod said:
I want to enable and disable toolbar items programatically. How would I do
this?
Individual items? You can go:
To refences a cascading (sub-menu) on a menu bar, you can go:
if IsInGroup(CurrentUser,"SuperUser" then
CommandBars("menu bar").Controls("records").
Controls("refresh").Visible = True
end if
And, here is another example:
if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then
CommandBars("myCustomBar").Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True
end if
Note that short cut menus are their own name also:
commandbars("your shortcut name").Contorls("contorlName").visiable = false
As for hiding the menu bars?
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.
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