Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Row Security

Author  Topic 

chicks2001
Starting Member

15 Posts

Posted - 2003-04-17 : 15:24:38
I have a database in which the users are associated with contacts and their respective service areas by a number. Both the contact table and the facility table have columns that contain the appropriate users number. I have managed to deturnine groups and assign users to those groups but the problem I am facing is that everyone sees every facility and every contact. In some cases this means a user may have to scroll through as many as 700 records. I need to know how do I limit what they can access by thier login user name? Can someone help me with this. Thanks in advance.

RatTail
Crackhead

98 Posts

Posted - 2003-04-18 : 04:18:51
Create a module with function who():

Function who()
who = Application.CurrentUser
End Function

Then you may use in your queries or Form Filter Property
this filter: where USERNAME = who()



Go to Top of Page

chicks2001
Starting Member

15 Posts

Posted - 2003-04-18 : 12:32:59
Thanks so much for the answer I will try that and see how it works. I also came up with entering in my queries criteria CurrentUser () but the draw back to that is that Admins do not have a number in the users table so I wasn't sure what to about that short of adding thier name a million times for each users POcontactID. I will see if this works. Thanks again

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-04-18 : 12:54:14
You could use an OR for this:

WHERE

CurrentUser = "ADMIN"

OR

ColumnInYourTable = CurrentUser



- Jeff
Go to Top of Page

RatTail
Crackhead

98 Posts

Posted - 2003-04-18 : 13:06:38
A bit confusing... Anyway, that's why I suggested to use the user function
in which you may write Select Case Statement:

Select Case x
Case "john": who = 1 ' john's POcontactID
Case "bert": who = 2
Case "kleo": who = 3
End Select


Go to Top of Page

chicks2001
Starting Member

15 Posts

Posted - 2003-04-18 : 13:43:38
I must admit sometime access security is very confusing to me. When seting up security on a sever it seem much easier but maybe because I have done that a few times.





Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-04-18 : 16:02:33
What security?

Go to Top of Page
   

- Advertisement -