Hi
I have created a login form in access (Code Below) which is a login screen to take me to the interface page. It works fine but i want to allow different levels of access IE 7 forms and the authorisation of the user in the table will determine which of the 7 forms to send them to. Any Ideas?
Private Sub LoginButton_Click()
If IsNull(Me.LoginUsernameText) Then
MsgBox "Please Enter Username", vbInformation, "Username Required"
Me.LoginUsernameText.SetFocus
ElseIf IsNull(Me.LoginPasswordText) Then
MsgBox "Please Enter Password", vbInformation, "Password Required"
Me.LoginPasswordText.SetFocus
Else
If (IsNull(DLookup("[Username]", "Users", "[Username] ='" & Me.LoginUsernameText.Value & "' And password = '" & Me.LoginPasswordText.Value & "'"))) Then
MsgBox "Incorrect Username or Password"
Else
MsgBox "Password accepted! Welcome!"
DoCmd.OpenForm "Interface"
End If
End If
End Sub
Bookmarks