Protect a hyperlink field from being edited

Ronaldo9

Registered User.
Local time
Today, 17:05
Joined
Jul 20, 2011
Messages
21
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.
 
Did you check what happens when the field is Locked? That should not prevent anyone from using the link. To Disable the field would make it inaccessible.
 
Actually, you're absolutely right ... I could've sworn I tried that before I posted my issue.:o..
Thank you very much,
Elias
 

Users who are viewing this thread

Back
Top Bottom