INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Login security

How do I get a user to only see there sections records by assets
Posted: 26 Feb 04

Trying to add security level to a database. without workgroups.  With this method users can only see data that applies to them.

Create a form with 2 textboxes for the login form. The first textbox is to enter user that is logging on. (There is faq that tell how to capture the network Logon if you wish not to enter the login name in the text box).  The user would need to enter the password in the second textbox (use the password input mask for password only asterisks)  The code below loks up the table to find the user name password and section the user is from.
Pass = DLookup("[Password]", "employees", "[login]='" & Me.Text1 & "'")
DivisionIDfilter = DLookup("[DivisionID]", "employees", "[login]='" & Me.Text1 & "'")

You need to store the user name and password in a table eg employees.  Having passwords in the table is not a concern for security as it is only going to be used to filter records, it is not meant as high level security.. If a section has 50 staff, they only need to see information on computers etc, and employees details for those 50 staff and not the 800 other staff.  If a password is stored in a table and the database window is only accessible by hidden button then the administrator does not have administrator permission to the database object.  You will also need to disable the shift key for startup. There is a faq on disabling the shift key see the  web site www.robotparade.co.uk . This site had a file called lock&unlock, that had a database that can lock and unlock the shift key (it is in 97 format but can convert to 2002).  

You will need to filter all form and reports to only let user see data that applies to there section using the code below
If filterOFF = True Then
Exit Sub
Else
Me.Form.Filter = "DivisionID=" & DivisionIDfilter
Me.FilterOn = True
End If
If DivisionIDfilter = 0 Then
Me.FilterOn = False
End If
End Sub

I hope this is a starting point for you database.


Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close