DLookup

ecupirate

Registered User.
Local time
Today, 00:14
Joined
Apr 19, 2002
Messages
14
I"m trying to lookup a value in an Employee's table and when a new record is added and put that vaule in my Results table. The value I'm looking up is a Yes/No field called active. I have used Dlookup before and it works. I'm not sure what I need to do different for a yes/No field. Below is the code that dosen't work for me. All I get is the #Name junk..

Me!Active = DLookup("[Active]", "tblEmployees", "[EmployeeID] = " & Me.EmployeeID)
 
I could be wrong, but I would think that if you're getting #name then your "Active" control is not a checkbox. If it's a text field, Access wouldn't know what to put in it if you only had a True/False value.

I'd try something like
Code:
IF (DLookup("[Active]","tablename","criteria) = True Then
Me!Active.Value = "TRUE"
ELSE
Me!Active.Value = "FALSE"

Of course, I'm assuming a lot of things here....
 

Users who are viewing this thread

Back
Top Bottom