Counting results of "yes" check boxes and combo box selections

C

compliance data

I have created a report that contains the results of data entered through a
form/subform sucessfully. However within the Report Footer i would like to
create a summary report of certain aspects contained in the main body of the
report.

2 cases;
1. In the input form I have a combo box with 2 selections say [C] &[ M] I
would like to count how many C's and howmany M's are contained in the report

2. also on the input form I have 3 check boxes to identify special
circumstances. I would like to count the "yes" responses for each of the 3
check boxes.

I have tried count, countif, IIF with no success
Assistance please Thank you
 
D

Duane Hookom

Case 1) If the combo box will always, forever, constantly contain only 2
selections and never more than 2, you can use two text boxes with control
sources like:
=Sum(Abs([UnnamedField]="C"))
=Sum(Abs([UnnamedField]="M"))

Case 2) similar to Case 1
=Sum(Abs([ChkBox1Field))
 
F

fredg

I have created a report that contains the results of data entered through a
form/subform sucessfully. However within the Report Footer i would like to
create a summary report of certain aspects contained in the main body of the
report.

2 cases;
1. In the input form I have a combo box with 2 selections say [C] &[ M] I
would like to count how many C's and howmany M's are contained in the report

Just add 1 for each value that is a "C", or "M".

Using unbound text congtrols in the Report Footer:
=Sum(IIf([ComboName]="C",1,0))
=Sum(IIf([ComboName]= "M",1,0))
2. also on the input form I have 3 check boxes to identify special
circumstances. I would like to count the "yes" responses for each of the 3
check boxes.

Combo box values are either -1 or 0, so all you need do to count the
Yes responses is Sum the boxes. The ABS() function returns the
positive value

Using unbound text controls in the Report Footer:

=ABS(Sum([CheckBoxA]))
=ABS(Sum([CheckBoxB]))
=ABS(Sum([CheckBoxC]))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top