Re: YES/NO calculations
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Tue, 9 Sep 2008 18:52:07 -0700
On Tue, 9 Sep 2008 17:06:19 -0700, Cruisinid wrote:
I entered the following into the box using the builder:
=abs[1completed]+[2completed]+[3completed] --those are the acutal names
I gave the checks so that I was comparing the same account number. After
check are made though, the total isn't being tallied. Should I have this "on
click" "on exit" or something special?
"fredg" wrote:
On Tue, 9 Sep 2008 14:07:01 -0700, Cruisinid wrote:
I have the form set up so that when someone has completed a task they place a
check mark in the box beside the item. (ie. I was planning on completing the
vacuuming, dusting and dishes but only did the dishes= 1 out of a possible 3,
right?).
The check marks are to be tallied up on the form (1 page). The user will
not know that the checks are being counted because the total box is not
visible.
If I understand your response, inside the "total" box in the properties area
I am to build something that says =sum([dishes]+[vacuuming]+[dusting]) and
because I only checked off the dishes it would show a value of one? Could it
be that easy?
"BruceM" wrote:
Do you mean within one record, or for a particular field in a range of
records? Are you referring to a Yes/No field, or text values?
Assuming you mean a Yes/No field, and that you are looking to total Yes
responses for the form's recordset you could put the following into an
unbound text box in the form footer:
=Sum(Abs([YourField]))
The Abs function returns the absolute value of a number. True is stored
as -1, and False as 0. Abs(-1) = 1, and Abs(0) = 0. The Sum function adds
these values, which has the effect of counting the records in which
YourField is True. Use your actual field name, of course.
If you are trying to count fields within a record:
=Abs([Field1] + Abs([Field2]) + Abs([Field3]) etc.
"Cruisinid" <Cruisinid@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B83D2AF0-4E78-4349-8DD7-3A5C1DDC7EFC@xxxxxxxxxxxxxxxx
I need to be able to calculate the number of "yes" values that appear on
the
form. How do I do that? (I currently have a hidden box on the form to
store
the information.. do I need to do a query and then insert the query info
there? And if so, how would I write the query?)
Thanks in advance,
Dawn
Almost that easy. A check box has a value of either -1 or 0.
Summing them would result in a negative number, i.e. -1 + -1 + 0 = -2.
So.. Use the Abs function to return the positive value:
=Abs(Sum([CheckA]+[CheckB] + [CheckC]))
This will return the total sum of all 3 check fields for ALL records.
Is that what you want?
Or do you want only the sum of the check marks for this one individual
record?
In which case you don't use Sum, you just add them.
=Abs([CheckA] + [CheckB] + [CheckC])
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
No, you place it directly on the control source property line of the
unbound control.
Problem is though, you didn't write the expression correctly.
You left out the very important parenthesis.
=abs([1completed]+[2completed]+[3completed])
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Follow-Ups:
- Re: YES/NO calculations
- From: Cruisinid
- Re: YES/NO calculations
- References:
- YES/NO calculations
- From: Cruisinid
- Re: YES/NO calculations
- From: BruceM
- Re: YES/NO calculations
- From: Cruisinid
- Re: YES/NO calculations
- From: fredg
- Re: YES/NO calculations
- From: Cruisinid
- YES/NO calculations
- Prev by Date: Re: Delete lines that automatically divide the form
- Next by Date: RE: Gray out entire form while pop-up form up?
- Previous by thread: Re: YES/NO calculations
- Next by thread: Re: YES/NO calculations
- Index(es):
Relevant Pages
|