By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,222 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,222 IT Pros & Developers. It's quick & easy.

Problems with reports, functions, and queries with parameters

P: 1
I'm trying to use the DCount() function in the Report Header of a new report. The ReportSource for this report is a parametered Query. My DCount call looks like:
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!
Oct 11 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
I'm affraid but parametred queries with dlookup Dsum Dcount doesn't work...

In fact what is the transmitted parameter ???....

Sorry but look for other way

If your report is based on the respective parametred query its better to use Sum() Count() and so on functions instaed the oders ones!

Best regards!
Oct 14 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.