Try this
=Sum(IIF([CheckBoxName] = True,nz([FieldName],0),0))
--
I hope that helped
Good luck
:
Thanks for your help. I used the formula "=Sum(nz([FieldName],0))", and it's
not working.
It gives me a total of all the records on the form whether I have those
records selected to post or not. I only want the total of those records that
are selected to post. The text box of total should simultaneous add or
subtract after I select or deselect those records on the form.
Thanks.
:
To sum the values of a field in the form you should use
=Sum(nz([FieldName],0))
If you want to add the sum of few fields
=Sum(nz([FieldName],0)+nz([FieldName2],0))
--
I hope that helped
Good luck
:
Thanks for your response. My form is a continuous form. The users will
allow to select the transactions individually by checking each box, or they
can click on a button to select all the transactions on the form.
What I want to do is to get a total in the text box of the transactions that
are selected whether the users select individually or select all when they
click on the command button.
Thanks.
:
if the form set to Single Form, to add up few fields in the form, write in
the control source of the text box
=nz(field1,0)+nz(field2,0)+nz(field3,0)+nz(field4,0)
--
I hope that helped
Good luck
:
I have a form which allows people to select (Yes/No checkbox) the
transactions that they want to post. What I want to do is I want to have a
text box on the bottom of the form that gives me total (on the transactions
that are selected) after they select each transaction.
I tried to use "DSum" and got an error message "#error".
Thanks.