Totalling check boxes

  • Thread starter Thread starter springschick
  • Start date Start date
S

springschick

I need to total check boxes. That I know how to do. My problem lies here.
What I need to summarize are the boxes that are not checked. I have used
=IIf([Load Safe]=0,1,0), where Load Safe is my checkbox. This changes the
values in my check box so I can count the checkboxes that were not checked.
My problem is counting them. The text box I used for my formula is called
Load Safe Checkbox. If I use =ABS(sum([Load Safe Checkbox])), when I run my
report, it asks for a parameter to be entered into Load Safe Checkbox. It is
not counting the number "1" . I need some assistance in tallying these
inverted checkboxes. Thank you.
 
Put a hidden textbox on the report...name it txtNoCheck. Set its RunningSum
property to "Over All". Set its ControlSource property to
=IIf([Load Safe]=0,1,0)

Then put a textbox in the Report_Footer section of the report (this textbox
will show the sum). Name it txtNoCheckSum. Set its ControlSource property to
=[txtNoCheck]
 
Thank you for the response. I did exactly this, and the total comes out as
"1". It is not adding. Anything else I should try?

Ken Snell (MVP) said:
Put a hidden textbox on the report...name it txtNoCheck. Set its RunningSum
property to "Over All". Set its ControlSource property to
=IIf([Load Safe]=0,1,0)

Then put a textbox in the Report_Footer section of the report (this textbox
will show the sum). Name it txtNoCheckSum. Set its ControlSource property to
=[txtNoCheck]
--

Ken Snell
<MS ACCESS MVP>



springschick said:
I need to total check boxes. That I know how to do. My problem lies here.
What I need to summarize are the boxes that are not checked. I have used
=IIf([Load Safe]=0,1,0), where Load Safe is my checkbox. This changes the
values in my check box so I can count the checkboxes that were not
checked.
My problem is counting them. The text box I used for my formula is called
Load Safe Checkbox. If I use =ABS(sum([Load Safe Checkbox])), when I run
my
report, it asks for a parameter to be entered into Load Safe Checkbox. It
is
not counting the number "1" . I need some assistance in tallying these
inverted checkboxes. Thank you.
 
In which section of the report did you put the new txtNoCheck textbox? It
needs to be in the same section as the checkbox control. And be sure that
you set the Running Sum property to Over All, as I noted.
--

Ken Snell
<MS ACCESS MVP>



springschick said:
Thank you for the response. I did exactly this, and the total comes out as
"1". It is not adding. Anything else I should try?

Ken Snell (MVP) said:
Put a hidden textbox on the report...name it txtNoCheck. Set its
RunningSum
property to "Over All". Set its ControlSource property to
=IIf([Load Safe]=0,1,0)

Then put a textbox in the Report_Footer section of the report (this
textbox
will show the sum). Name it txtNoCheckSum. Set its ControlSource property
to
=[txtNoCheck]
--

Ken Snell
<MS ACCESS MVP>



springschick said:
I need to total check boxes. That I know how to do. My problem lies
here.
What I need to summarize are the boxes that are not checked. I have
used
=IIf([Load Safe]=0,1,0), where Load Safe is my checkbox. This changes
the
values in my check box so I can count the checkboxes that were not
checked.
My problem is counting them. The text box I used for my formula is
called
Load Safe Checkbox. If I use =ABS(sum([Load Safe Checkbox])), when I
run
my
report, it asks for a parameter to be entered into Load Safe Checkbox.
It
is
not counting the number "1" . I need some assistance in tallying these
inverted checkboxes. Thank you.
 
My mistake - I forgot to move it! It works beautifully. Thank you so much for
your help!

Ken Snell (MVP) said:
In which section of the report did you put the new txtNoCheck textbox? It
needs to be in the same section as the checkbox control. And be sure that
you set the Running Sum property to Over All, as I noted.
--

Ken Snell
<MS ACCESS MVP>



springschick said:
Thank you for the response. I did exactly this, and the total comes out as
"1". It is not adding. Anything else I should try?

Ken Snell (MVP) said:
Put a hidden textbox on the report...name it txtNoCheck. Set its
RunningSum
property to "Over All". Set its ControlSource property to
=IIf([Load Safe]=0,1,0)

Then put a textbox in the Report_Footer section of the report (this
textbox
will show the sum). Name it txtNoCheckSum. Set its ControlSource property
to
=[txtNoCheck]
--

Ken Snell
<MS ACCESS MVP>



I need to total check boxes. That I know how to do. My problem lies
here.
What I need to summarize are the boxes that are not checked. I have
used
=IIf([Load Safe]=0,1,0), where Load Safe is my checkbox. This changes
the
values in my check box so I can count the checkboxes that were not
checked.
My problem is counting them. The text box I used for my formula is
called
Load Safe Checkbox. If I use =ABS(sum([Load Safe Checkbox])), when I
run
my
report, it asks for a parameter to be entered into Load Safe Checkbox.
It
is
not counting the number "1" . I need some assistance in tallying these
inverted checkboxes. Thank you.
 
You could use the following expression in the summary textbox. There is no
reason to do the conversion at all in Load Safe Checkbox unless you want to
display that value in the detail line.

= Abs(Sum([Load Safe]=0))

or this alternative expression.

= Count(IIF([Load Safe] = 0,1,Null))



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top