Well actually each field is specific to certain users so I would
need to be able to set permissions for specific fields. Can this be
done with this table?
:
It's depend how often you are going to use this table, to how many
forms you want to set permissions.
The most simple permission table, will contain two fields
1. Form name , so you can use this table for several forms
2. User name , enter the name of the users you want them to have
permission, such as Admin
The sample code I gave you, will look for a record of the user name
+ form name, if it find a match, it will set the permission to
true. else to false
If Dcount("[User_Name]","[Table Name]","[User Name] = '" &
CurrentUser() & "' And [Form Name] = 'Form1'") > 0 Then
Me!CEODate.Enabled = True
Me!CEODate.Locked = False
Else
Me!CEODate.Enabled = False
Me!CEODate.Locked = True
End If
--
The next line is only relevant to Microsoft''s web-based interface
users. If I answered your question, please mark it as an answer.
It''s useful to know that my answer was helpful
HTH, good luck
:
How exactly would this table look? I'm a little unclear how to set
up a table that defines permissions. I like your idea though I
wouldn't know where to being with this table.
:
I would create a table that holds the users names that has a
permission, and then use a dcount to check if the user been
defined in this table, that way it make it easier adding users or
removing users permission
If Dcount("[User_Name]","[Table Name]","[User Name] = '" &
CurrentUser() & "'") > 0 Then
Me!CEODate.Enabled = True
Me!CEODate.Locked = False
Else
Me!CEODate.Enabled = False
Me!CEODate.Locked = True
End If
===============================
To use few selections as you tried, try this
If CurrentUser() = "Admin" Or CurrentUser() = "User2" Or
CurrentUser() = "User3" Then
Me!CEODate.Enabled = True
Me!CEODate.Locked = False
Else
Me!CEODate.Enabled = False
Me!CEODate.Locked = True
End If
--
The next line is only relevant to Microsoft''s web-based
interface users.
If I answered your question, please mark it as an answer. It''s
useful to know that my answer was helpful
HTH, good luck
:
How do I make this code have multiple users in it? Right now I
have "Admin" as the user but I want to be able to have specific
multiple users. I tried using "Or" but I was getting error
messages when I did this. Can anyone help?
If CurrentUser() = "Admin" Then
Me!CEODate.Enabled = True
Me!CEODate.Locked = False
Else
Me!CEODate.Enabled = False
Me!CEODate.Locked = True
End If