Full Version: Dlookup command
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
indhukrishna
Hello,
I am using dlookup command to select records based on the user selection in 3 combo boxes.
It works for me until I do for 2 combos. the code that works is:

=DLookUp("[Reference_price]";"archive2";"[DealID]= '" & [Forms]![AREA]![Combo38] & "' AND [Model-Nr]= '" & [Forms]![AREA]![Combo36] & "'")

I am trying extend its search based on 3 combos..the statement that doent work is below:-(
=DLookUp("[Reference_price]";"archive2";"[DealID]= '" & [Forms]![AREA]![Combo38] & "' AND [Model-Nr]= '" & [Forms]![AREA]![Combo36] & "' AND [Changed On]= #"[Forms]![AREA]![Combo22] & "#”)

The Combo that displays the date is the result of a Now() function. Is that any hinderence. For my application, I need that combo to show results of Now() function. So, I cannot change it.
Is there any way how I can overcome this problem?????

Thanks for any help!!
cheers.
ScottGem
Try:

=DLookUp("[Reference_price]";"archive2";"[DealID]= '" & [Forms]![AREA]![Combo38] & "' AND [Model-Nr]= '" & [Forms]![AREA]![Combo36] & "' AND [Changed On]= #" & Int([Forms]![AREA]![Combo22]) & "#”)

You might also want to check out naming conventions.

HTH
indhukrishna
Hi,
Thnx for the input..
I am still getting syntax errors!!
dunno why..i just copy-pasted ur cmd line
Reg,
IK
ScottGem
Where are you putting the code and what is the exact error message?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.