Counting in a Report

  • Thread starter Thread starter Chris Guimbellot
  • Start date Start date
C

Chris Guimbellot

Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris
 
Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris

In the Report Footer, add 7 unbound controls:
As control sources:
=Sum(IIf([YourField] = value1,1,0))
name this one "Sum1"

=Sum(IIf([YourField] = value2,1,0))
Name this "Sum2"

=Sum(IIf([YourField] = value3,1,0))
Name this "Sum3"

= Sum([YourField])
Name this TotalSum

=[Sum1]/[TotalSum]*100
=[Sum2]/[TotalSum]*100
=[Sum3]/[TotalSum]*100

Set the above 3 control's Format property to Percent
 
Fred,

That worked like a champ. Thanks a lot. I appreciate it.

Chris

fredg said:
Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris

In the Report Footer, add 7 unbound controls:
As control sources:
=Sum(IIf([YourField] = value1,1,0))
name this one "Sum1"

=Sum(IIf([YourField] = value2,1,0))
Name this "Sum2"

=Sum(IIf([YourField] = value3,1,0))
Name this "Sum3"

= Sum([YourField])
Name this TotalSum

=[Sum1]/[TotalSum]*100
=[Sum2]/[TotalSum]*100
=[Sum3]/[TotalSum]*100

Set the above 3 control's Format property to Percent
 
Back
Top