Dlookup problem

  • Thread starter Thread starter Ray
  • Start date Start date
R

Ray

Cannot get dlookup to work, although I have in the past.
Set up a test bed of two unrelated tables.
Looked up the key in one table using a combo box and
updated the value in the form using the table
Keep getting run time error 2465 can't find field "I"

Me.[F1] = DLookup([F1], [Table1], [Table1].[Key] = [LKUP])

In debug F1 in form green is correct
F1 in dlookup blue is correct
LKUP CAR is correct
It has found the correct field and I am trying to change
green to blue but still keep getting this error
 
Ray,

Syntax problem. Try:

Me.[F1] = DLookup("[F1]", "Table1", "[Table1].[Key] = ' " & [LKUP] & " ' ")

if the Key field is text, or

Me.[F1] = DLookup("[F1]", "Table1", "[Table1].[Key] = " & [LKUP])

if the Key field is numeric.

HTH,
Nikos
 
Thank you, Ray(novice)

-----Original Message-----
Ray,

Syntax problem. Try:

Me.[F1] = DLookup("[F1]", "Table1", "[Table1].[Key] = ' " & [LKUP] & " ' ")

if the Key field is text, or

Me.[F1] = DLookup("[F1]", "Table1", "[Table1].[Key] = " & [LKUP])

if the Key field is numeric.

HTH,
Nikos

Ray said:
Cannot get dlookup to work, although I have in the past.
Set up a test bed of two unrelated tables.
Looked up the key in one table using a combo box and
updated the value in the form using the table
Keep getting run time error 2465 can't find field "I"

Me.[F1] = DLookup([F1], [Table1], [Table1].[Key] = [LKUP])

In debug F1 in form green is correct
F1 in dlookup blue is correct
LKUP CAR is correct
It has found the correct field and I am trying to change
green to blue but still keep getting this error


.
 
Back
Top