Protecting a field within a form

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

Guest

I am new to the security part of this but I see that you can restrict groups
to update a table. Is there any way that based upon a signon that you can
restrict a particular field unless the user has certain permissions?
 
I am new to the security part of this but I see that you can restrict groups
to update a table. Is there any way that based upon a signon that you can
restrict a particular field unless the user has certain permissions?

Only by denying everyone (except developer/administrators) any access
to the table entirely; instead, provide them with only Forms to update
the table, and set the Locked properties of the controls you want
restricted to Yes.

John W. Vinson[MVP]
 
Only by denying everyone (except developer/administrators) any access
to the table entirely; instead, provide them with only Forms to update
the table, and set the Locked properties of the controls you want
restricted to Yes.

RWOP queries? - or maybe I'm missing the point.
 
RWOP queries? - or maybe I'm missing the point.

Can you set a RWOP query to allow one field to be edited and another
to be protected, in the same query? That would be neat but I don't
know how!

John W. Vinson[MVP]
 
Can you set a RWOP query to allow one field to be edited and another
to be protected, in the same query? That would be neat but I don't
know how!

I read - or misread - the OP as wanting to restrict visibility rather
than updatability...
 
I appreciate your suggestions although that did work I need to have the
ability to modify the field within this form if the person has sufficent
permissions. The field I want to ba able to modify if the person has the
right is a drop down combo box.

I tried creating another table and created a form based upon that new table
which just had one field in it. That field was a drop down combo box that I
added two peices of info. In my main form I created a subform area to
display this one field and I have not had much luck in getting the info to
display corretly. I just want to be able to limit that drop down box to who
can modify and who can only view the data while being able to modify the
other fields in the form.
 
I don't understand the purpose of your new table.

To meet the situation you originally explained, ignore my previous posts
and follow John Vinson's suggestion: set things up so the users can only
access the data via your forms, and on the forms lock the controls that
display the fields you don't want the users to be able to modify.

To lock or unlock the controls depending on the user, you have to use
VBA code in the form's Open event procedure that gets the user name,
checks their permissions, and adjusts the Locked property of the
controls accordingly.
 
John you hit on what I'm trying to do however, I'm not familar with VBA code
to accomplish this. Could you point me to where I could find the info on how
to plug the proper VBA code into the Open Event procedure. This would
accomplish what I'm trying to do which again is to limit who can modify and
who can only view a particular field, in this case a drop down combo-box,
within the form.

Thanks ahead of time for your help.

Jay
 
Here's a function (there are many versions around) which tells you
whether or not a user is in a given security group:

Public Function IsUserInGroup(strGroup As String, _
strUser As String) As Boolean

Dim Dummy As String
On Error Resume Next
Dummy = DBEngine(0).Users(strUser).Groups(strGroup).Name
IsUserInGroup = (Err.Number = 0)
Err.Clear
On Error GoTo 0
End Function

If you stick it in a module (a standard module, not a class module or a
form's module) you can do stuff like this in a form's Open event
procedure:

If IsUserInGroup("MoltoAdministroso", CurrentUser()) Then
cboImportantStuff.Locked = False
Else
cboImportantStuff.Locked = True
End If
 
Back
Top