restricting a button based on user group

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

Guest

could someone provide me with the exact syntax for the following
pseudo code to restrict a user's access to a particular button.
for example:

if usergroup = "Admin" then
cmdModifyRecord.enabled = false
else
cmdModifyRecord.enabled = true
end if
 
Well, this is tough since a user will belong to more than one group. There
is code out there that let's you do a "IsUserInGroup" type of thing. You
might do a search and start with that code.

But, since I am a member of the "users" group and the "DBAdmin" group in my
particular fle, you can see how it might not be as straight-forward as your
question indicates.

Rick B
 
So how does one go about creating a button that is either restricted to a
group of users or enabled for a group of users?
 
In my opinion, you don't. You can give some groups access to a form that
allows modifications, and others not. Or you can change the table access
based on their group. Objects (like buttons and controls on a form) aren't
controlled by user-level security.

Again, do a search and find the function that will determine if they are in
a particular group, then you could do that function and say if the returned
result was true, then lock or unlock the button. But, you'd have to create
that function, and you'd have to hardcode which group applied. Not a very
dynamic way of handling it. If anyone ever took over your database who did
not know vba, it might be tough fo rthem to maintain this form.

Rick B
 
Back
Top