DLookup function - search criteria x 2

adamnorsworthy

Registered User.
Local time
Today, 18:31
Joined
Nov 9, 2005
Messages
13
Hey there,

I would like to find a value from a record, and I am using the DLookup function. To find the right record I need to provide two references, the customer id and the booking id. I have tried to use 'And' such as:

dateineed = DLookup("[Arrival date]", "detbooking", "[BookingID]= " & refe.Value And "[CustomerID]= " & customer.Value)

with no luck. How can I get access the correct record in a record set when I can only specify the exact record if I have use two references?

Kind regards, Adam.
 
Because the criteria is a string, you have to include the AND inside the quotes:

e.g.

dateineed = DLookup("[Arrival date]", "detbooking", "[BookingID]= " & refe.Value & " And [CustomerID]= " & customer.Value)

Regards,
Pete
 

Users who are viewing this thread

Back
Top Bottom