Check Box Privileges

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

Guest

I have a check box on a form that reads "Approved by Director?" Is there a
way I can restrict access to this box so the Director is the only person who
can click it?
 
The easiest way is to not allow any access to this box on your form, then
build a separate form (that only the director has access to) which allows
the box to be used.

If you don't want to do that, you would need to build code that checked the
current user's group and then set the box to enabled or not. You would have
to create a separate module to test a user's group. Both of these issues
are addressed in here pretty often. Just search for "IsInGroup" and you
should fin them.
 
A simplier way might be to leave the checkbox enabled but check the user if
anybody tries to click it.

If you only have one user that is director, you can also check the
currentuser() function to see who it is in the beforeupdate event of the
control
then set cancel = true essage if the current ;user is not the director


Private Sub ApprovedCheckbox_BeforeUpdate(Cancel As Integer)
If currentuser()<>'Director then
cancel=true
Msgbox "You don't have permission to change this!" 'optional message
end if
End Sub
 
Back
Top