Thanks - how do I refer to a menu in order to examine its properies
collection?
CommandBars("menu bar")
Menu bar is the "main" built in bar....
So, you could try
CommandBars("menu bar").visible = false
But, I NEVER did write any Actual code to hide the menu bars of my
applications anyway. If you specify your own menu bar in the tools ->
startup settings, then you actually don't need any code to hide the built
and menu bars anyway. This approach takes zero code, and likely runs
faster/sooner than if you try and wait for the whole application to load,
then load the VBA libraries, and THEN start to run your code.
For menu bar manipulation you can do stuff like:
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 I mentioned, I not tried the 1st approach, and until the form + your code
*STARTS* to run, you likely still see the menu bar for a period of time
(thus, I suggest you use the 2nd approach (/runtime switch to hide
everything. It also has the added benefit of NOT showing the access icon in
the upper left corner, and will show ONLY your custom icon specified. So, I
like the runtime idea the best..).
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