Can somebody please tell me what is wrong with this code:
userID = DLookup("[UserID]", "users", "([userLogon]= '" & Forms!frmLogon!srcUserLogon & "' AND [userPassword] = '" & Forms!frmLogon!srcuserPassword & "')")
If isNull(userID) Then
etc....
It works fine if the username and password are correct, but if not I get a message 'Invalid Use of Null'.
userID is an Autonumber, that I use as a primary key in the user table.
I've also tried with:
userID = 0
userID = DLookup("[UserID]", "users", "([userLogon]= '" & Forms!frmLogon!srcUserLogon & "' AND [userPassword] = '" & Forms!frmLogon!srcuserPassword & "')")
If userID = 0 Then
etc.....
Which also gets an 'Invalid Use of Null' but only when the username/password are incorrect.
The code is some from a database I did in 1999, where it works fine. I can't see why it does this.
userID = DLookup("[UserID]", "users", "([userLogon]= '" & Forms!frmLogon!srcUserLogon & "' AND [userPassword] = '" & Forms!frmLogon!srcuserPassword & "')")
If isNull(userID) Then
etc....
It works fine if the username and password are correct, but if not I get a message 'Invalid Use of Null'.
userID is an Autonumber, that I use as a primary key in the user table.
I've also tried with:
userID = 0
userID = DLookup("[UserID]", "users", "([userLogon]= '" & Forms!frmLogon!srcUserLogon & "' AND [userPassword] = '" & Forms!frmLogon!srcuserPassword & "')")
If userID = 0 Then
etc.....
Which also gets an 'Invalid Use of Null' but only when the username/password are incorrect.
The code is some from a database I did in 1999, where it works fine. I can't see why it does this.