I have a table of users and passwords to allow different views of a database.
I have used two textbox inputs to feed the username/passwords respectively. I want to use a combo for the users instead of a text box so that the form is updated with every addition/deletion/amednment.
This is what i am using:
Private Sub Login_Click()
Password = DLookup("[password]", "tblUsers", "[Username]='" & txtUsername & "'")
If Password = txtPassword Then
isDirector = DLookup("[isDirector]", "tblUsers", "[Username]='" & txtUsername & "'")
If isDirector = True Then
DoCmd.OpenForm "Startup Fast Cabs Director"
Else
DoCmd.OpenForm "Startup Fast Cabs"
End If
Else
MsgBox "Wrong password"
End If
End Sub
Its probably simple .I am a novice so any help appreciated.
Barny
I have used two textbox inputs to feed the username/passwords respectively. I want to use a combo for the users instead of a text box so that the form is updated with every addition/deletion/amednment.
This is what i am using:
Private Sub Login_Click()
Password = DLookup("[password]", "tblUsers", "[Username]='" & txtUsername & "'")
If Password = txtPassword Then
isDirector = DLookup("[isDirector]", "tblUsers", "[Username]='" & txtUsername & "'")
If isDirector = True Then
DoCmd.OpenForm "Startup Fast Cabs Director"
Else
DoCmd.OpenForm "Startup Fast Cabs"
End If
Else
MsgBox "Wrong password"
End If
End Sub
Its probably simple .I am a novice so any help appreciated.
Barny