Checkboxes Formula

G

gjoneshtfc

Hello

I have a tabular form which has a checkbox for each record. In the form
footer i have two calculations. One is a total of the values of all the
records which works fine. The second calculation does not work however
so if anyone can help me it will be greatly appreciated:

I need the second calculation to total all the values who's checkbox is
checked and then subtract this from the total in the first calculation.
I am currently doing it with the following formula in the control
source of the textbox:

IIF([Cleared?]=yes,([Total]-[BalanceDue]),[Total])

This works when one checkbox is checked. However, when the second one
is checked it only takes that value from the total. What i need is to
sum all the [BalanceDue] that has a tick and then subtract this from
the total in [Total] but i have no idea how to get it working!

Any help would be great,
Kind regards, Gareth Jones
 
G

Guest

I have three text box controls in the bottom of my tabulary form.

txtYesNoCount which has a control source of =Count([YesNo])

txtYesNoSum which has a control source of =Abs(Sum([YesNo]))

txtYesNoDiff which has a control source of =Count([YesNo])-Abs(Sum([YesNo]))

They give me the number of records; the number marked Yes (-1), and the
difference between the two.

Yes is equal to -1 so you can sum them up. The Abs function takes the
negative number and turns it to a positive. I guess you could simplify things
by:
=Sum([YesNo])+Count([YesNo])
 

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