Klatuu,
I've used that method many many times, and it works fine, for either
numeric or text
criteria.
=DLookUp("[Addr1]","tblCustomers","CustID = Forms!Form2!CustID")
uses a LongInteger to lookup a Text value.
=DLookUp("[CustID]","tblCustomers","Addr1 = Forms!Form2!Addr1")
uses a Text value to lookup a LongInteger value.
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
The reference to the form control needs to be outside the quotes.
=DLookUp("[ItemNumber]","DescriptionInfo", "[Description] = " &
Forms![ReturnData]![Description])
I notices Al said it did not need the single quote delimiters, but I am
not
sure that is correct. Omitting them usually means you are looking up a
numeric value. I would code it as:
=DLookUp("[ItemNumber]","DescriptionInfo", "[Description] = '" &
Forms![ReturnData]![Description] & "'")
:
Mr. Camp,
I get the same error. Access still thinks that Forms! is a Field
on my
Table.
:
Try...
=DLookUp("[ItemNumber]","DescriptionInfo", "[Description] =
Forms![ReturnData]![Description]")
No brackets on the table name, and Forms![ReturnData]![Description]
is a string
value, and
can be used directly, without quotes.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
I am trying to use DLookup to automatically fill in a Value on a
Form but
with no success. It seams that Access is looking for a Forms!
Field when I
try to enter the Funtion into the Control Source. What am I doing
wrong. The
Funtion I am trying to use is
=DLookUp("[ItemNumber]","[DescriptionInfo]","[Description] = ' " &
Forms![ReturnData]![Description] & " ' ").