Dlookup help Please !!

P

Pinacle

Could someone help me with the following dlookup code.

=DLookUp("[LateJune2009] ","LeadTime"," [COSTCODE] = [Combo135] and
[MATERIALDESCRIPTION] = '"&[Combo 137]&" ' ")

If i replace 'Combo 137' with a sample description this code is working
fine. I think the problem is with the quotations. Material Description is of
string type.

Additional question: Do i need to modify the above dlookup function if i
have to use it in vba code.

Thanks in Advance !!
 
T

Tom van Stiphout

On Fri, 11 Sep 2009 21:21:01 -0700, Pinacle

I would write that third argument along these lines:
"CostCode=" & cboCostCode & " and MatlDescr='" & cboMatlDescr & "'"

Name your comboboxes something sensible.
All uppercase object names are harder to read.

-Tom.
Microsoft Access MVP
 

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

Similar Threads

dlookup 2
DLookup and Nz 0
Dlookup is broken... 1
dlookup 2
Dlookup error 4
Access DLOOKUP with IF Function in MS ACCESS DB 0
DLookUp error 2
Dlookup error 13 7

Top