954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dlookup() error

im using the dlookup() to prievew password at a unbound textbox within a criteria that the username and security question that are entered matches the database.
Ex: user forget password.
he enters his user name, and select the security question, and answer the question.
if these data match the data in the tabels, then his password should be shown in the text box.

Me.passwordtxt.Value = DLookup("PASSWORD", "SYS_USER", "[USERNAME]=" & Me.usernametxt & " And[ANSWER]=" & Me.answertxt & "")


the error which comes is expression not match ? and tells me the username ??

any help will be very kind of you all, i tried working on this for two days, and posted many questions and didnt get accurate answers, any way thanks for any help in advance.

deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -1
Solved Threads: 0
 

Your answer is here: http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/364355
Basically the same question, but with more code wrapped around it, made it easier to figure out what was wrong with your code. In this thread, you aren't using single-quotes to wrap around your embedded variables, plus DLookup needs a variant datatype variable to put it's results.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: