Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting records in reports

Status
Not open for further replies.

teebird

Technical User
Dec 11, 2001
239
Hi everyone -

I have a report based on a query. What I want to do is count the number of records for each detail line in the report and then the total at the end. My report is set up like below. The field FID has 2 types (ARREST and SUMMONS) and the field SID has 2 types (ADULT and JUVENILE).

Report Header
My Report Title

Page Header
DateREC OIC SID FID

STNID Header
STNID is ADELAIDE

Detail
DateREC - OIC - SID - FID
01/12/01 - Brown - Adult - Summons
02/12/01 - Green - Adult - Summons
02/12/01 - Hills - Juvenile - Arrest

Count of files for this detail line
Adelaide = 2 x Adult Summons Files
Adelaide = 1 x Juvenile Arrest file

This is the function I am using but it displays #Error

=DCount("[FileID]","qryFilesReport","[FileID] = 'ARREST'")
=DCount("[StaturaID]","qryFilesReport","[StaturaID] = 'Adult'")

Report Footer
Total number of Summons files = 2
Total number of Arrest files = 1

The DCount function I have created keeps coming up with a error and I have tried a number of option but without success.

Can someone have a look and tell me what I am doing wrong.

Many thanks
tee




 
Try

Adult Summons =sum(iif(SID = "Adult", 1, 0))
Juvenile Arrest = sum(iif(SID = "Juvenile", 1, 0))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top