A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using DCount in report with parameter qry



 
 
Thread Tools Display Modes
  #1  
Old August 14th, 2009, 02:12 AM posted to microsoft.public.access.reports
Flopbot
external usenet poster
 
Posts: 60
Default Using DCount in report with parameter qry

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")

  #2  
Old August 14th, 2009, 05:57 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Using DCount in report with parameter qry

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.
--
Duane Hookom
Microsoft Access MVP


"Flopbot" wrote:

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")

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.