I have a secured database split into front and back ends. I have two
security groups FirstLevel and SecondLevel, each group can see, access and do
different things in the database.
However both groups can use the main form [frmClientDetails], there is one
control on the form [txtClientName] that can currently be changed by both
groups, i wish to change this so that only the SecondLevel group can change
it. My only options on the "User and Group Permissions" is to change the
level on the whole table or form.
Is there anyway that i can write a simple macro or vba code that says
something along the lines of
If CurrentUser() is in FirstLevel Group then [txtClientName].locked = True
otherwise [txtClientName].locked = False
The If statement is relatively easy, what i don't know how to do is get the
user security group information into it.
Thanks for your help.
You can’t place security on the field level in access. However you could
separate the fields into 2 different tables and create a one to one
relationship. Then apply the desired security setting to each table.

Signature
-Matt
Microsoft Certified Professional
> I have a secured database split into front and back ends. I have two
> security groups FirstLevel and SecondLevel, each group can see, access and do
[quoted text clipped - 16 lines]
>
> Thanks for your help.
I hoped it would be obvious from my post that i knew that you can't place
security at field level and that due to this being my main table that my
entire database is built on it is also not really possible to change it to
two tables.
What i am asking for is, is there a piece of code that i can use to ask the
database to specify the security group(s) the CurrentUser belongs to or vice
versa does the CurrentUser belong to a specific security group.
> I have a secured database split into front and back ends. I have two
> security groups FirstLevel and SecondLevel, each group can see, access and do
[quoted text clipped - 16 lines]
>
> Thanks for your help.
Matt - 09 Nov 2006 15:14 GMT
The code to determine the Group can be found at
http://support.microsoft.com/default.aspx?scid=/support/access/content/secfaq.as
p#_Toc493299691

Signature
-Matt
Microsoft Certified Professional
> I hoped it would be obvious from my post that i knew that you can't place
> security at field level and that due to this being my main table that my
[quoted text clipped - 25 lines]
> >
> > Thanks for your help.
Matt - 09 Nov 2006 15:16 GMT
VBA Code:
Public Function IsUserInGroup(UserName As String, GroupName As String) As
Boolean
On Error Resume Next
UserName = DBEngine.Workspaces(0).Groups(GroupName).Users(UserName).Name
IsUserInGroup = (Err = 0)
End Function

Signature
-Matt
Microsoft Certified Professional
> I hoped it would be obvious from my post that i knew that you can't place
> security at field level and that due to this being my main table that my
[quoted text clipped - 25 lines]
> >
> > Thanks for your help.
Brendan Reynolds - 09 Nov 2006 15:20 GMT
See these recent discussions in the Google archives ...
http://groups.google.com/group/microsoft.public.access/browse_frm/thread/af0a199
ef7941dc1
http://groups.google.com/group/microsoft.public.access/browse_frm/thread/ee57c6b
572731e13

Signature
Brendan Reynolds
Access MVP
>I hoped it would be obvious from my post that i knew that you can't place
> security at field level and that due to this being my main table that my
[quoted text clipped - 32 lines]
>>
>> Thanks for your help.