User Level Security

G

Guest

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.
 
G

Guest

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.
 
G

Guest

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.
 
G

Guest

The code to determine the Group can be found at
http://support.microsoft.com/default.aspx?scid=/support/access/content/secfaq.asp#_Toc493299691

--
-Matt
Microsoft Certified Professional


Emma Hope said:
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.

Emma Hope said:
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.
 
G

Guest

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


--
-Matt
Microsoft Certified Professional


Emma Hope said:
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.

Emma Hope said:
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.
 
B

Brendan Reynolds

See these recent discussions in the Google archives ...

http://groups.google.com/group/microsoft.public.access/browse_frm/thread/af0a199ef7941dc1

http://groups.google.com/group/microsoft.public.access/browse_frm/thread/ee57c6b572731e13

--
Brendan Reynolds
Access MVP


Emma Hope said:
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.

Emma Hope said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top