Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am using a Dlookup to have a pass

Status
Not open for further replies.

paulbradley

Programmer
Oct 9, 2002
158
GB
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!
 
Hi,
You need a comparaison and make sur you don’t have extra spaces.

criteria = "[username]='" & [frmUsername]![PasswordTextbox] & "'"


Jean-Paul
Montreal
To send me E-Mail, remove “USELESSCODE”.
jp@USELESSCODEsolutionsvba.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top