Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

referring to a field on a report

Status
Not open for further replies.

stuckagain1

Technical User
May 3, 2004
86
0
0
US
I would like to have an expression on a report that uses the dlookup function to look for a value that is on the report to see if it exists in another query......

something like:
=iif(IsNull(dlookup("donor_id","collections thank you pet lib",donor_id=donor_id on report))," ","**") except I don't know if you can refer to the donor_id on the report and if you can, I don't know the syntax.......

thanks!
 
You may try something like this:
=IIf(IsNull(DLookUp("donor_id", "[collections thank you pet lib]", donor_id=" & [donor_id textbox name])), " ", "**")
I assumed donor_id is defined as numeric.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
thanks, but i get a 'your expression contains an invalid syntax' 'you may have entered an operand without an operator' error message......this is what i have:

=IIf(IsNull(DLookUp("donor_id", "[collections thank you batch pet lib]",donor_id=" & [donor_id]))," ", "**")

the field donor_id has a number data type. the text box name on the report is donor_id. (i tried renaming the text box, but it didn't help.)

thanks for your help!
 
He missed a quote mark.

=IIf(IsNull(DLookUp("donor_id", "[collections thank you batch pet lib]",donor_id=" & [donor_id]))," ", "**")

is missing a quotation mark in the third part of the DLookUp function. It should be

=IIf(IsNull(DLookUp("donor_id", "[collections thank you batch pet lib]","donor_id=" & [donor_id]))," ", "**")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top