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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.