Hey,

I'm trying to set up a validation behind a text box in access and I want it to find certain values in a table. Unfortuantly I am having a problem with this piece of code a few lines long:

I am trying to perform a procedure which checks whether a customer in a table already exists by comparing First, Last Name and Post Code. Unfortunatly I have a probelm in the FirstName variable. This is what I have tried:



FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] = LCustomerID")

Where
LCustomerID = DLookup("CustID", "CustomerInfo", "[CustomerInfo]![LName] = Forms![Add_Customer]![txtLName]")

But this did not work So I tried this:

FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] =(DLookup("CustID", "CustomerInfo", "[CustomerInfo]![LName] = Forms![Add_Customer]![txtLName]"))")

Still does not work

Can anyone help me with this problem? I will be very greatful