Sum of checkbox

S

Steve

Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked, but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count(). There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
 
F

Fons Ponsioen

What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
 
M

Marshall Barton

Steve said:
I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked, but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count(). There
are 3 records but only 2 checked boxes!


The sum worked, it just returned the negative of the result
because True is represented by -1 (False is 0).

Just use =Abs(Sum(Sickness)) to make sure the reault is
positive.
 
S

Steve

Fons,

I have tried that but I get #Error :/

Is there another function that can be used?

Cheers,
Steve

-----Original Message-----
What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
-----Original Message-----
Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked, but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count(). There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
.
.
 
F

Fons Ponsioen

Hi Steve.
I think you have named the textbox the same as the data
element in your table/query. rename the textbox and make
sure that the formula is still correct. Sometimes the
autocorrect makes some changes.
Hope this resolves the issue.
Fons
-----Original Message-----
Fons,

I have tried that but I get #Error :/

Is there another function that can be used?

Cheers,
Steve

-----Original Message-----
What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
-----Original Message-----
Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked, but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count(). There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
.
.
.
 
S

Steve

Hmmmm,

On the report, I have a Checkbox called Sicknesschk, bound
to the Field Sickness.

I am attempting to show the total number of 'checks' in
Text2 with the Control Source of =Abs(Sum(Sicknesschk))

Is this correct? I am still getting #Error in Text2 !!!!

I may go to the long-winded 'coded' way if this doesnt
work soon!

Cheers,
Steve.


-----Original Message-----
Hi Steve.
I think you have named the textbox the same as the data
element in your table/query. rename the textbox and make
sure that the formula is still correct. Sometimes the
autocorrect makes some changes.
Hope this resolves the issue.
Fons
-----Original Message-----
Fons,

I have tried that but I get #Error :/

Is there another function that can be used?

Cheers,
Steve

-----Original Message-----
What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
-----Original Message-----
Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked, but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count(). There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
.

.
.
.
 
M

Marshall Barton

Marsh,

I have tried using ABS(Sum(Sickness)) but still get
#Error :(

weird!


Not wierd if the Fons' response is your problem ;-)

(you didn't forget the = sign, did you?)
--
Marsh
MVP [MS Access]



 
F

Fons Ponsioen

Hi Steve.
I just made sure.
if in your detail of your report you have a checkbox
named "Sicknesschk" tah you can put another textbox in the
report footer or group footer with "=Abs(Sum(Sicknesschk))"
and you will get the desired result.
Make sure you have that textbox (I guess you named it
Text2) in either the group header or footer or the report
footer.
Hope this helps.
Fons
-----Original Message-----
Hmmmm,

On the report, I have a Checkbox called Sicknesschk, bound
to the Field Sickness.

I am attempting to show the total number of 'checks' in
Text2 with the Control Source of =Abs(Sum(Sicknesschk))

Is this correct? I am still getting #Error in Text2 !!!!

I may go to the long-winded 'coded' way if this doesnt
work soon!

Cheers,
Steve.


-----Original Message-----
Hi Steve.
I think you have named the textbox the same as the data
element in your table/query. rename the textbox and make
sure that the formula is still correct. Sometimes the
autocorrect makes some changes.
Hope this resolves the issue.
Fons
-----Original Message-----
Fons,

I have tried that but I get #Error :/

Is there another function that can be used?

Cheers,
Steve


-----Original Message-----
What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
-----Original Message-----
Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked,
but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I just
get the results of -2 for sum() and 3 for count().
There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
.

.

.
.
.
 
S

Steve

Fons,

It works!!!!

I had it in the page footer rather than report footer.
Personally, I wouldnt of thought it made a difference, but
hey!

Cheers, we got there eventually :)

Steve.

-----Original Message-----
Hi Steve.
I just made sure.
if in your detail of your report you have a checkbox
named "Sicknesschk" tah you can put another textbox in the
report footer or group footer with "=Abs(Sum (Sicknesschk))"
and you will get the desired result.
Make sure you have that textbox (I guess you named it
Text2) in either the group header or footer or the report
footer.
Hope this helps.
Fons
-----Original Message-----
Hmmmm,

On the report, I have a Checkbox called Sicknesschk, bound
to the Field Sickness.

I am attempting to show the total number of 'checks' in
Text2 with the Control Source of =Abs(Sum(Sicknesschk))

Is this correct? I am still getting #Error in Text2 !!!!

I may go to the long-winded 'coded' way if this doesnt
work soon!

Cheers,
Steve.


-----Original Message-----
Hi Steve.
I think you have named the textbox the same as the data
element in your table/query. rename the textbox and make
sure that the formula is still correct. Sometimes the
autocorrect makes some changes.
Hope this resolves the issue.
Fons
-----Original Message-----
Fons,

I have tried that but I get #Error :/

Is there another function that can be used?

Cheers,
Steve


-----Original Message-----
What you are seeing is truly the sum sunce each yes is
saved as a minus 1.
To count the yesses, use Sum(Abs([Sickness]))
Hope this helps.
Fons
-----Original Message-----
Hi,

I have a report that displays rows from a query, one of
which is a checkbox.

I want a total for checkbox's that have been checked,
but
cant work out how its done.

I've tried =sum(Sickness) and =count(Sickness) or I
just
get the results of -2 for sum() and 3 for count().
There
are 3 records but only 2 checked boxes!

Can anyone help?

Cheers,
Steve.
.

.

.

.
.
.
 

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