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!

Dlookup in report 1

Status
Not open for further replies.

rccline

Technical User
Jun 13, 2002
341
US
I have a report which I would like to use a Dlookup to find a value.

=DLookUp("grossac","tblGrossacres","entity=LE")


I have a table named tblGrossAcres.

My entity = LE
my field to lookup is grossac.

I run the report and get #error#

What is wrong?

Thanks.

Robert
 
I assume "LE" is a constant string value.

I would place tblGrossacres in the report's record source and set the criteria under the entity field to
"LE"
Add the GrossAc field to the grid so you can use it in the report. Otherwise try:

=DLookUp("grossac","tblGrossacres","entity='LE'")


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Placing the apostrophe on either side of LE ('LE') did the trick. I needed to access an external table as I had another query for my record source.

Thanks so very much!

Robert
 
Hi Guys,

Can anyone spot an error with this function:

=nz(DCount("[FailRsn]","Test Query1 Damage By Vehicle","FailRsn='Impact Fracture'")

This function shown below returns a result but when I add criteria, an error message comes up saying that I am missing an ] or /

=nz(DCount("[FailRsn]","Test Query1 Damage By Vehicle "))

Mant Thanks

Hayton McGregor

 
Count the open and close parens ie: ()s.

How can your second expression work when you have a space as the last character of your query name?

Also, I never use Nz() without providing two arguments.
=nz(DCount("[FailRsn]","Test Query1 Damage By Vehicle"),0)


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top