Sum a Count Control???

tafnuef1

Registered User.
Local time
Today, 06:02
Joined
Apr 22, 2010
Messages
43
Ok on my report I have a control called Prepper Errors. I have another Control that counts the number of Prepper Errors per Batch Number ID.

For Example> "Prepper Name" may have 5 Batches and we are counting each error in each Batch.
so for Batch Number 1 I have counted 5 errors
Batch Number 2 I have counted 2 errors
Batch Number 3 i have counted 4 errors
So now I want to get a total sum for that "Prepper Name"
I know if I make a textbox and set the Control Source as =Sum[Count of Prepper Errors] will give me an error.

Can someone take me through the steps to sum up these counts for each Prepper? HELP!!:confused:
 
I'm almost certain you can use the DCount function. If I understand correctly what you are asking is the overall number of errors irrespective of batch number.
Got me at a time when I must go off line, but will look later and suggest a syntax, but you may like to look at my posting under general tab - "DCount - have I beaten Microsoft".

CU

Regards.
GeoffT
 
Without seeing the data structure it is hard to be specific but it is likely to involve an aggregate (Sum) query. Group By prepper name and set a derived column to Sum the error counts. It may be that you will count the total error records in the group instead.

Using a DCount would be inefficient since a separate one would be required for each batch. It is much more efficient to include the values in the recodset of the report.

Note that the Sum function works on fields in the recordset of a form or report but derived controls cannot be summed. However, usually a suitable derived field in the recordset can be summed or counted.
 

Users who are viewing this thread

Back
Top Bottom