I have a form that I want to limit who can edit any field on a form, one group can edit all and the other group cannot edit any field. I have tried opening the form read-only but it still allows me to edit the fields. (I know the dsfuserName() is working because I am using it for another purpose in the DB)
If dsfUserName() = "xxxxx" Then 'users who can edit
DoCmd.OpenForm "form_PSSA_Tracker_Update", , , "ID = " & IntID, acFormEdit
Else
DoCmd.OpenForm "form_PSSA_Tracker_Update", , , "ID = " & IntID, acFormReadOnly
End If
I also tried it in the Form_Current() event by using the AllowEdits property like below and it also allows me to edit:
If dsfUserName() = "xxxxx" Then 'users who can edit
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
An ideas what I am doing wrong?
Thanks!
If dsfUserName() = "xxxxx" Then 'users who can edit
DoCmd.OpenForm "form_PSSA_Tracker_Update", , , "ID = " & IntID, acFormEdit
Else
DoCmd.OpenForm "form_PSSA_Tracker_Update", , , "ID = " & IntID, acFormReadOnly
End If
I also tried it in the Form_Current() event by using the AllowEdits property like below and it also allows me to edit:
If dsfUserName() = "xxxxx" Then 'users who can edit
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
An ideas what I am doing wrong?
Thanks!