Calculated Field value from lookup table entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in a query named CreatedLogin. I wish to populate this field
with a value from a field named LoginName from a table named zzLogin.
DLookup does not work, nor does a direct lookup. There are no forms in this
application. How would I do this?
 
Thanks Doglas that worked.

Why does it not work to specify the record ("ID"=1) in the DLookup?
 
If you're saying you want the LoginName for that record in table zzLogin
where the value of field ID is 1, you'd write:

DLookup("LoginName", "zzLogin", "ID=1")

If ID were a text field, as opposed to a numeric one, you'd use

DLookup("LoginName", "zzLogin", "ID='1'")

Exagerated for clarity, that's

DLookup("LoginName", "zzLogin", "ID= ' 1 ' ")
 
Thanks Doug,

Syntax nails me everytime.

Douglas J. Steele said:
If you're saying you want the LoginName for that record in table zzLogin
where the value of field ID is 1, you'd write:

DLookup("LoginName", "zzLogin", "ID=1")

If ID were a text field, as opposed to a numeric one, you'd use

DLookup("LoginName", "zzLogin", "ID='1'")

Exagerated for clarity, that's

DLookup("LoginName", "zzLogin", "ID= ' 1 ' ")
 
Back
Top