Expand|Select|Wrap|Line Numbers
- Username.SetFocus
- If Username = “Staff1” And Password = “Staff1” Then
- MsgBox “Welcome”
- DoCmd.Close
- DoCmd.Openform “Staff1”
- ElseIf Username = “Staff2” And Password = “Staff2” Then
- MsgBox “Welcome”
- DoCmd.Close
- DoCmd.Openform “Staff2”
- ElseIf Username = “Manager1” And Password = “Manager1” Then
- MsgBox “Welcome, please use caution when making changes”
- DoCmd.Close
- DoCmd.Openform “Manager1”
- Else
- MsgBox “Please re-enter username and password”
- End If
1. At the moment this form is little more than a gimmick as anyone entering the program can access all objects in the navigation pane with a single click WITHOUT logging in. Is there a way to prevent users accessing objects in the navigation pane without logging in? I also want prevent users accessing items that aren’t on the relevant forms e.g. the manager1 form gives the user access to all objects in the navigation pane whereas the staff1 and staff2 forms only allow access to different forms.
2. Is there a code that will restrict the number of times you can re-enter the username and password?
3. If there a way of tracking users once they have logged in. I have table which shows data that has been edited and would like to be able to add a field which shows which user edited the data?
4. Is there a way of restricting things like the design view on forms?