paulbradley
Programmer
I am using a Dlookup to have a password entry into a part of my database.
I have a form with to fields - frmUsername and frmPassword. I also have a table called security and to fields, password and username.
When the OK button is pressed on the login screen I obviously want the password of the username lookedup and compared with what they typed in, this is the code I have so far:
criteria = "[username] '" & [frmUsername] & "'"
valid_password = DLookup("[Password]", "Security", criteria)
I can then obviously go on to say something like if valid_password = the password they typed continue - but the above code does not work! I'm fairly sure it is to do with the 'criteria =' bit, thanks!
I have a form with to fields - frmUsername and frmPassword. I also have a table called security and to fields, password and username.
When the OK button is pressed on the login screen I obviously want the password of the username lookedup and compared with what they typed in, this is the code I have so far:
criteria = "[username] '" & [frmUsername] & "'"
valid_password = DLookup("[Password]", "Security", criteria)
I can then obviously go on to say something like if valid_password = the password they typed continue - but the above code does not work! I'm fairly sure it is to do with the 'criteria =' bit, thanks!