DLookup with two criteria (integer variable)

jasmin_m

New member
Local time
Today, 04:02
Joined
Jan 10, 2010
Messages
8
Dim x As Integer
Dim y As Integer

x = 1
y = 2

a = DLookup("[field]", "table", _
"[field2] = " & x And "[field3] = " & y)

In above example criteia is incorect,
how can I write it correct.
 
Try:
a = DLookup("[field]", "table", "[field2] = " & x & " And [field3] = " & y)
...the And needed to be in the string.
 
It's the higher oxygen content down here at 5,000'. :p
 
Is it posible to use DLookup with two table(domain)

example;

a = DLookup("[field]", "table1 & table2", "[field2] = " & x & " And [field3] = " & y)
 
To my knowledge, no. If you can create a query that joins the two tables appropriately, you could use the DLookup() against that.
 

Users who are viewing this thread

Back
Top Bottom