Try this:
=DLookUp("[PCC]","Location","[TXUsite] =" & Forms![Transactions]![TXUsite])
Cheers
> =DLookUp("[PCC]","Location","[TXUsite] = Forms![Transactions]![TXUsite]")
>
> This is returning nothing to my PCC field in my form. Where do I need to
> place this funtion and is this correct?
Justin Barnett - 11 Jan 2005 17:39 GMT
It's returning nothing to my field... any suggestions?
> Try this:
>
[quoted text clipped - 6 lines]
> > This is returning nothing to my PCC field in my form. Where do I need to
> > place this funtion and is this correct?
> =DLookUp("[PCC]","Location","[TXUsite] = Forms![Transactions]![TXUsite]")
>
> This is returning nothing to my PCC field in my form. Where do I need to
> place this funtion and is this correct?
What is the datatype of the [TXUsite]? Number or Text?
Is this code being placed in an event on theTransaction form or in a
control source of an UNBOUND control on that form? Or on a different
form? It makes a difference.
Assuming [PCC] and [TXUsite] are field's in the [Location] table, and
you have a form with a control named [TCUsite].....
1) As code in an event on the Transaction form assuming [TXUsite] is
text:
=DLookUp("[PCC]","Location","[TXUsite] = '" & Me![TXUsite] & "'")
If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & Me![TXUsite])
2) In a control source on that form:
=DLookUp("[PCC]","Location","[TXUsite] = '" [TXUsite] & "'")
If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & [TXUsite])
3) On a different form or in a Module:
=DLookUp("[PCC]","Location","[TXUsite] = '" &
Forms![Transactions]![TXUsite] & "'")
If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & Forms!Transaction![TXUsite])
The form "Transaction" must be open when the DLookUp is run.

Signature
Fred
Please only reply to this newsgroup.
I do not reply to personal email.