Passing report values to a query
Posted
by
Beavis
on Stack Overflow
See other posts from Stack Overflow
or by Beavis
Published on 2011-02-26T23:22:46Z
Indexed on
2011/02/26
23:24 UTC
Read the original article
Hit count: 171
ms-access
|ms-access-2007
I'm a novice with Microsoft Access as my background is mostly .NET. I'm sure what I'm trying to accomplish is dead simple but I need some direction. I have a report and a query. The query returns a single numeric value based on a single numeric criteria.
Select total from table where id = [topic]
I have placed a text box on my report so I can feed the id to this query and in return get the total. It seems like DLookUp is what I want but no matter how I construct it, I get an "#Error" in the text box when I run the report.
Currently my DLookUp looks like this (I just hard-coded now for simplicity): =DLookUp("[total]","myquery","[topic] = 3")
How can I pass a value from a field on my report to a query so I can return the query's single numeric value?
Thanks.
© Stack Overflow or respective owner