Use Dlookup() on report text box

message from Scott on 5 May 2004
I have a text box on my report which I want the
RecordSource of it to point to a quary where a certain
field in the query matches a certain field in the record
source of the report, both fields are Numeric, indexed;
could any one provide me the expression how to do that.?

Thanks

Scott
 
Wayne Morgan replied to Scott on 5 May 2004
Set the control source of the textbox to something like this. You'll need to
modify it for the real names.

=DLookup("[FieldToReturn]", "[QueryName]", "[MatchingFieldName]=" &
[ReportFieldName])
 
Allen Browne replied to Scott on 5 May 2004
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

The end result will be something like this:
=DLookup("[SomeField]", "[SomeTable]", "SomeNumberField = " &
[MatchingNumberField])
 

Archived message: Use Dlookup() on report text box (MS Access Database)