Dlookup for with two criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
Can the criteria of Dlookup compose of two fields.
How can we write the syntax.
I tried
CQ = DLookup("[QTc]", "Stockinventorylog",
"[RCID]=Forms![Stockinventory]![StockinventoryLog Subform]![ID]-1" And "[RC]
= 31112.03")

Please can you help me solve this problem
 
Bassel said:
Hello
Can the criteria of Dlookup compose of two fields.
How can we write the syntax.
I tried
CQ = DLookup("[QTc]", "Stockinventorylog",
"[RCID]=Forms![Stockinventory]![StockinventoryLog Subform]![ID]-1"
And "[RC] = 31112.03")

Please can you help me solve this problem

The And needs to be inside the quotes. The simplest way to think about it
is that the third argument of a Domain Aggregate can be any valid SQL WHERE
clause that would work in a query with the word "WHERE" stripped off the
front.
 
Back
Top