using dlookup

G

gary verno

can not get dlookup statement syntax correct

A form collects cboUsername and Password and compares it
using dlookup against UserName and orgPassword text
fileds in tblLogin.

If Me.txtPassword.Value = DLookup
("[orgPassword]", "tblLogin", "UserName= '" &
Me.cboUserName.Value & "'") Then

LoginID = Me.cboUserName.Value

Any suggestions?
 
K

Ken Snell

Remove the [ ] from the first argument and then try it again.

If Me.txtPassword.Value = DLookup("orgPassword", "tblLogin", "UserName= '" &
Me.cboUserName.Value & "'") Then
 
R

Rick Brandt

gary verno said:
can not get dlookup statement syntax correct

A form collects cboUsername and Password and compares it
using dlookup against UserName and orgPassword text
fileds in tblLogin.

If Me.txtPassword.Value = DLookup
("[orgPassword]", "tblLogin", "UserName= '" &
Me.cboUserName.Value & "'") Then

LoginID = Me.cboUserName.Value

Any suggestions?

Assuming you don't have this on multiple lines in your code window it looks OK
to me. If it is on multiple lines you would need line continuation
characters(_).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top