How to use DLookup in form

Sean Illingworth

New member
Local time
Today, 01:06
Joined
Nov 5, 2009
Messages
5
When I use DLookup like:
? DLookup("[Processor name]", "querySophia", "[property_id] = 39")

It gives me correct answer:
Dave Irvine

But When I am using a form and want set value automatically:
? DLookup("[Processor name]", "querySophia","[property_id]= " & Me![property_id])

System Error:
"Variable not yet created in this context"

How to deal with this problem? Any help will be appreciated :o
 
Me![property_id]) can mean a control on the form or a field in the Record Source with Access normally defaulting to the control. You seem comparing the contol value with a field of the same name from a query that is perhaps also the record source of the form.

I think Access is getting confused. I would try changing the control name.
 
Me![property_id]) can mean a control on the form or a field in the Record Source with Access normally defaulting to the control. You seem comparing the contol value with a field of the same name from a query that is perhaps also the record source of the form.

I think Access is getting confused. I would try changing the control name.


I tried to change the control name, that worked. Thanks a lot

Best Regards
 

Users who are viewing this thread

Back
Top Bottom