Count Function on Report.

  • Thread starter Thread starter sigh
  • Start date Start date
S

sigh

On my report I have show all of the Check Boxes. Some
of them are check and some are not check. How do I use the
COUNT function to count the items on the check box ONLY
the one with checked? I would like to place this Count
function on to the Text box. Where should I place y text
box on the report? Is't on the Report footer?

Any help would be very appreciated.
 
A checked checkbox has a value of True, which Access treats as -1 and False,
or unchecked, as 0. Place a textbox on the report and set its Control Source
to

=Abs([YesNoFieldName])

and set its count to OverAll or OverGroup as desired. The Abs function,
absolute value, will make the number a positive number. If what you are
wanting to show is the sum of this in the footer, then set the Visible
property of this textbox to No and in the footer, report or group footer
depending on the count option above, place a textbox with its control source
set to this textbox.

Example:
=txtCountingTextbox

Since the footer gets processed after all of the detail records, the last
value of the counter (i.e. the total) will be what shows in the footer's
textbox.
 
Thanks for the reply. But on the text box still show as
the total of the Check boxes which include the Checked and
unchecked boxes. Here's Examples:
On te report details section it show five checked boxes.
2 are checked and 3 are not checked. The checkBox field is
call fldChkBox. I place the Text box on the Report Footer.
On the Text box Control Source. I set to "=Count
[fldChkBox]". When I un and report. The value on the Text
box show as 5. Even I use the "=Count(ABS(fdChkBox)) I
still got 5. It count all the Check box it show on the
report. I only want ot Count the Checked one which it is
2. How do I do that?

Thanks






-----Original Message-----
A checked checkbox has a value of True, which Access treats as -1 and False,
or unchecked, as 0. Place a textbox on the report and set its Control Source
to

=Abs([YesNoFieldName])

and set its count to OverAll or OverGroup as desired. The Abs function,
absolute value, will make the number a positive number. If what you are
wanting to show is the sum of this in the footer, then set the Visible
property of this textbox to No and in the footer, report or group footer
depending on the count option above, place a textbox with its control source
set to this textbox.

Example:
=txtCountingTextbox

Since the footer gets processed after all of the detail records, the last
value of the counter (i.e. the total) will be what shows in the footer's
textbox.

--
Wayne Morgan
Microsoft Access MVP


sigh said:
On my report I have show all of the Check Boxes. Some
of them are check and some are not check. How do I use the
COUNT function to count the items on the check box ONLY
the one with checked? I would like to place this Count
function on to the Text box. Where should I place y text
box on the report? Is't on the Report footer?

Any help would be very appreciated.


.
 
Don't use Count: use Sum.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



sigh said:
Thanks for the reply. But on the text box still show as
the total of the Check boxes which include the Checked and
unchecked boxes. Here's Examples:
On te report details section it show five checked boxes.
2 are checked and 3 are not checked. The checkBox field is
call fldChkBox. I place the Text box on the Report Footer.
On the Text box Control Source. I set to "=Count
[fldChkBox]". When I un and report. The value on the Text
box show as 5. Even I use the "=Count(ABS(fdChkBox)) I
still got 5. It count all the Check box it show on the
report. I only want ot Count the Checked one which it is
2. How do I do that?

Thanks






-----Original Message-----
A checked checkbox has a value of True, which Access treats as -1 and False,
or unchecked, as 0. Place a textbox on the report and set its Control Source
to

=Abs([YesNoFieldName])

and set its count to OverAll or OverGroup as desired. The Abs function,
absolute value, will make the number a positive number. If what you are
wanting to show is the sum of this in the footer, then set the Visible
property of this textbox to No and in the footer, report or group footer
depending on the count option above, place a textbox with its control source
set to this textbox.

Example:
=txtCountingTextbox

Since the footer gets processed after all of the detail records, the last
value of the counter (i.e. the total) will be what shows in the footer's
textbox.

--
Wayne Morgan
Microsoft Access MVP


sigh said:
On my report I have show all of the Check Boxes. Some
of them are check and some are not check. How do I use the
COUNT function to count the items on the check box ONLY
the one with checked? I would like to place this Count
function on to the Text box. Where should I place y text
box on the report? Is't on the Report footer?

Any help would be very appreciated.


.
 
Back
Top