Passing report values to a query
- by Beavis
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.