DCount("[fieldname]","[QueryName]","[fieldname]=1")where QueryName is the name of the parametered Query. However, when I go to Print Preview, instead of giving the count Access simply displays "#ERROR"
I'm pretty sure that the problem comes from the fact that the query has parameters. When I tested the same syntax on a query without parameters, everything worked fine. I think Access is having issues resolving the fact that QueryName is, in fact, a query which returns a table. Usually Access has no problem with this query if I don't call it from the form, as it just prompts me to fill in the parameters. This is the case when I set QueryName as the ReportSource. However, Access does not prompt me when I reference QueryName in the DCount(), and so I wonder if I've really confused it.
Any ideas on how I can fix this? Ideally, I'd like to be able to reference the table that is the ReportSource from inside the DCount(). But really I just want to be able to include a Count of the number of records which have a certain value in a certain field, where those records match the criteria established by a form/query set.
Thanks for helping a newbie!