dlookup help needed!

  • Thread starter Pam S via AccessMonster.com
  • Start date
P

Pam S via AccessMonster.com

I'm having a problem with a dlookup statement using 2 criteria. Both
statements work individually, but when I try to put both together using AND
the lookup fails. I'm sure it's the quotes, or somethng similar causing my
problem, but I've looked & worked on it until I can't see straight!
Please advise how I need to be writing this to get the correct information
returned:
DLookUp("[Rate]","[HourlyCont]","[ClientID]=' & [Forms]![frmTime Input Form]!
CLNT_NUMB &'" And [HourlyCont]![CONT_NUMB] =' & [CONT_NUMB] & ' ")


I really need to get past this problem to get finished with my project.
Thank you for your assistance~
 
G

Guest

Are Client_ID and CONT_NUMB text or numeric ?
Is CONT_NUMB on the form as well as CLNT_NUMB ?

If Text

DLookUp("[Rate]","[HourlyCont]","[ClientID]= '" & [Forms]![frmTime Input
Form]! CLNT_NUMB & "' And [CONT_NUMB] = '" & [Forms]![frmTime Input
Form]![CONT_NUMB] & "'")

If Numeric

DLookUp("[Rate]","[HourlyCont]","[ClientID]= " & [Forms]![frmTime Input
Form]! CLNT_NUMB & " And [CONT_NUMB] = " & [Forms]![frmTime Input
Form]![CONT_NUMB])
 
P

Pam S via AccessMonster.com

Sorry...Both fields are text (also have letters).
Client ID is on the main form, which is frmTime Input Form
Cont_Numb comes from the frmTime subform (on the Time Input Form)

Thanks-
Are Client_ID and CONT_NUMB text or numeric ?
Is CONT_NUMB on the form as well as CLNT_NUMB ?

If Text

DLookUp("[Rate]","[HourlyCont]","[ClientID]= '" & [Forms]![frmTime Input
Form]! CLNT_NUMB & "' And [CONT_NUMB] = '" & [Forms]![frmTime Input
Form]![CONT_NUMB] & "'")

If Numeric

DLookUp("[Rate]","[HourlyCont]","[ClientID]= " & [Forms]![frmTime Input
Form]! CLNT_NUMB & " And [CONT_NUMB] = " & [Forms]![frmTime Input
Form]![CONT_NUMB])
I'm having a problem with a dlookup statement using 2 criteria. Both
statements work individually, but when I try to put both together using AND
[quoted text clipped - 7 lines]
I really need to get past this problem to get finished with my project.
Thank you for your assistance~
 

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