Using DCount in report with parameter qry

  • Thread starter Thread starter Flopbot
  • Start date Start date
F

Flopbot

Hi. I’m having a little trouble with this. I don’t know a lot about reports
so any advice would be appreciated. I’m using Access 2003 and have a report
based on “Departmental Hours by Month Parameter Qryâ€. This parameter query
returns the total number of hours worked (grouped by department) and prompts
me for the year and month volunteered. The top “half†of my report displays
this information while I want the bottom “half†to return several numbers
that don’t come from the main query.


I was able to get the first number (“Total # of Active Volunteersâ€) to work
using:

=DCount("[Volunteer ID]","Active Volunteers Qry KEEP")


However, I can’t get the second number (“Total # of Volunteers this Monthâ€)
to work and I don’t know why. The main difference is that this is a
parameter query. It uses identical prompts to the report’s main query. Do I
need to do something special for parameter queries?

=DCount("[Volunteer ID]","Volunteers by Month Parameter Qry KEEP")
 
IMO, parameter prompt queries are not appropriate. Always use controls on
forms to get input from users. Rather than DCount() I would consider a
subreport.
 
Back
Top