Calculation in Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I watched the "Calculation in Text Box" thread. This is very similar to my
needs.

I want a calculation in a report but I'm not sure of the formula necessary.

I need to calculate a paid $ value per person. This is created by the total
value of the objects ordered =SUM([value])

This works like a charm on the report.
However, what I need to do is subtract the value of the objects that have
not been paid for. This is deternmined by a yes/no checkbox. The report has
a list of each person, the objects they ordered, the value of each object and
the check box indicating whether or not they have paid (both yes and no must
be shown).

Doe, John Total paid - $40

book $10 yes
CD $20 no
radio $30 yes


Any ideas?

Thank you!
 
Exactly.
I know I can do this through a query that just has the "paid" items on it
but I also need to show the items that have not been paid for.
 
Example A: Dsum("Amt", "tblObjects", "Paid = True AND Name = 'Doe, John'" )

Example B: Dsum("Amt", "tblObjects", "Paid = False AND Name = 'Doe, John'")

In examples A & B, "tblObjects" is the name of the table which holds the
list of items that have or have not been paid. The "Amt" part is the name of
the field that holds the amount. The "Paid" part of the examples is the
field that holds the Yes/No. Example A will give you the sum of all the paid
items. Example B will give you the sum of all the not Paid.
 
Because you will not be able to feed the student name in the report, the
following examples are probably more appropriate. Please note that I have
entered a space before and after the single quotation marks. This is is for
illustration purpose only and a the blank spaces should not be used in the
real calculation:

Example A: Dsum("Amt", "tblObjects", "Paid = True AND Name = ' " &
reports!rptPaid!txtStudentName & " ' " )

Example B: Dsum("Amt", "tblObjects", "Paid = False AND Name = ' " &
reports!rptPaid!txtStudentName & " ' " )
 
I get it!
Many thanks.

little ole me said:
Because you will not be able to feed the student name in the report, the
following examples are probably more appropriate. Please note that I have
entered a space before and after the single quotation marks. This is is for
illustration purpose only and a the blank spaces should not be used in the
real calculation:

Example A: Dsum("Amt", "tblObjects", "Paid = True AND Name = ' " &
reports!rptPaid!txtStudentName & " ' " )

Example B: Dsum("Amt", "tblObjects", "Paid = False AND Name = ' " &
reports!rptPaid!txtStudentName & " ' " )
 
Back
Top