How turn on/off menubar options

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been given the task of making this Access db read-only for some users.

Some custom menubar options are used for editing and I need to turn them off
or on depending on the user.

This is an old Access 97 system so the menubars are all macros.

How do I do this, its a mystery to me? My Access books don't even mention it.
 
This is an old Access 97 system so the menubars are all macros.

The menu bars might call macros, but that is simply a choice of design, not
the fact that menubars themselves are macros, or anything special to do with
macros.

Most of my menu bars call code in the forms (since, those forms started out
with a whole bunch of command buttons, and over time to reduce clutter, you
start moving command buttons to the menu bar, and have the menu bar then
call the code in the form (that way, both the menu bar, and some of the
reaming command buttons can share and call the same code).

I have no idea how to control the menu bar via macros, but in code you can
most certainly "disable" or even "hide" a menu bar.

Here is some actual code I used to turn off options in a menu bar:

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

Note that short cut menus are their own name also:

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

You can also replace "visible" with "enabled" to "gray" out the option
(really, your choice).

And, I did wrap some of the the above lines for ease of read....
 
Back
Top