Dlookup with Multiple Criteria question

papic1972

Registered User.
Local time
Tomorrow, 09:26
Joined
Apr 14, 2004
Messages
122
Hi,

I'm having a tough time getting the following Dlookup to work:

DLookup("[ConfirmedLoad]=0", "qryDriver4a2", "DeliveryDate=#" & Format(Forms!frmLoadAllocation!cboAllocationDate.Value, "mm/dd/yyyy") & "#" & "AND [StateID]='1'")

My original Dlookup (which worked fine!) didn't require StateID but it is necessary to include it now. Can anyone help me with the correct syntax for the StateID portion? Thank you.
 
Apologies for my brain explosion, i've worked out a better method, this works if anyone else needs it!

DLookup("[ConfirmedLoad]=0", "qryDriver4a2", "[StateID]=" & Forms!frmLoadAllocation!txtState & " And DeliveryDate=#" & Format(Forms!frmLoadAllocation!cboAllocationDate.Value, "mm/dd/yyyy") & "#")

Have a great day!
 
Hello,

You could try

DLookup("[ConfirmedLoad]", "[qryDriver4a2]", "[DeliveryDate]=datevalue('" & Me.Controls("cboAllocationDate").Value & "') and [StateID]='" & Trim(Nz(Me.Controls("txtState").Value)) & "'")

Rgds
 
Hi Pat Hartman,

Why are saying that DLookup("[ConfirmedLoad]=0" can't be right? It works fine.
 

Users who are viewing this thread

Back
Top Bottom