lorirobn wrote:
Quote:
I am trying to create two custom menu bars for my application, one for
read-only users (without delete record), and one for update-access
users (with delete record).
It's been a little while since I used mdws and I'm at home away from my
work where I have secured Jet apps.
But rather than two separate menu bars, my approach would be to have
one. This makes it much easier to maintain, IMO.
Your startup form or code in your autoexec macro could have code similar
to the following air code. It assumes the menu bar is called "mnuMain"
and that the delete control is the third menu item along mnuMain:
Select case Currentuser 'or group identifier
Case "Full Access User1", "Full Access User2", etc
Commandbars("mnuMain").Controls(3).Enabled = true
Case else 'Read only user/group
Commandbars("mnuMain").Controls(3).Enabled = false
end select
You should not rely on this code however, just in case there is some
kind of odd unanticipated occurance that has the delete menu control
enabled for read only users. You can include code in your delete
function that is assigned to the onaction property of the control item 3
to check the user and display "You cannot delete these records" or
something in a message box. Of course, your permissions would take care
of this sort of thing.
--
Tim
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto