I'm trying to protect a hyperlink field from being edited by certain users.
The form gets the windows username, then looks up the security group of the user from a table. Based on the group, it should allow or deny the user to edit this field.
Everybody should be allowed to click on the link and open the document. So I can't lock/unlock the field.
I tried this code in the BeforeUpdate event, but it doesn't work:
strUserName = Environ("UserName")
Dim strGroup
strGroup = DLookup("Group", "tblUsers", "Username = '" & [strUserName] & "'")
If strGroup <> "DM" Or strGroup <> "DM Admin" Then
MsgBox "You are not authorize to edit this field", vbCritical
Exit Sub
End If
The problem is the field has a windows browse button where you can browse for file, select it and populate it this way.... So even users who are not authorized to edit the field can use the browse button and edit the field and access seems to allow that.
Any help is appreciated.
Thanks,
Elias.
The form gets the windows username, then looks up the security group of the user from a table. Based on the group, it should allow or deny the user to edit this field.
Everybody should be allowed to click on the link and open the document. So I can't lock/unlock the field.
I tried this code in the BeforeUpdate event, but it doesn't work:
strUserName = Environ("UserName")
Dim strGroup
strGroup = DLookup("Group", "tblUsers", "Username = '" & [strUserName] & "'")
If strGroup <> "DM" Or strGroup <> "DM Admin" Then
MsgBox "You are not authorize to edit this field", vbCritical
Exit Sub
End If
The problem is the field has a windows browse button where you can browse for file, select it and populate it this way.... So even users who are not authorized to edit the field can use the browse button and edit the field and access seems to allow that.
Any help is appreciated.
Thanks,
Elias.