using dlookup

  • Thread starter Thread starter gary verno
  • Start date Start date
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?
 
Remove the [ ] from the first argument and then try it again.

If Me.txtPassword.Value = DLookup("orgPassword", "tblLogin", "UserName= '" &
Me.cboUserName.Value & "'") Then
 
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(_).
 
Back
Top