wrightyrx7
Registered User.
- Local time
- Today, 15:00
- Joined
- Sep 4, 2014
- Messages
- 104
Hi all,
I have successfully made a Login form, and now its time to put in some sort of permissions.
I have a table called 'Users' with a filed called 'Access Type', there are to choices in this field 'Admin' or 'User'
I want to HIDE/LOCK as much as I can in access (Tables, Queries, Forms, Ribbon etc) if a 'User' logs in. But Show Everything if an admin logs in.
Any help would be great.
This is my basic 'Login' form code:
Regards
Chris
I have successfully made a Login form, and now its time to put in some sort of permissions.
I have a table called 'Users' with a filed called 'Access Type', there are to choices in this field 'Admin' or 'User'
I want to HIDE/LOCK as much as I can in access (Tables, Queries, Forms, Ribbon etc) if a 'User' logs in. But Show Everything if an admin logs in.
Any help would be great.
This is my basic 'Login' form code:
Code:
Private Sub Command1_Click()
If IsNull(Me.txtLoginID) Then
MsgBox "Please enter a Login ID", vbInformation, "Login ID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter a Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
If (IsNull(DLookup("[Login ID]", "[Users Extended]", "[Login ID]='" & Me.txtLoginID.Value & "' and Password='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect Login ID or Password."
Else
cUser = DLookup("[Username]", "[Users Extended]", "[Login ID]='" & Forms![Login]!txtLoginID.Value & "'")
DoCmd.Close acForm, "Login", acSaveNo
DoCmd.OpenForm "Call Log"
End If
End If
End Sub
Chris