Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with totals

Status
Not open for further replies.

bgibsonIYD

Technical User
Jun 18, 2001
28
US
I have a form called "Totals", with the fields: TOTAL AMOUNT DUE, AMOUNT PAID, and AMOUNT NOT PAID. I want these fields to be filled in by another form "Registration". The fields to be used are REGISTERED (checkbox), REGISTRATION FEE (listbox), & PAID (checkbox). The TOTAL AMOUNT DUE should be the sum of the REGISTRATION FEE's for all records that the REGISTERED checkbox is set to true. The AMOUNT DUE should be filled in with the sum of all the REGISTRATION FEE's that the REGISTERED checkbox and the PAID checkbox's are both set to true. The AMOUNT NOT PAID field should be the subtraction of the AMOUNT PAID from the TOTAL AMOUNT DUE.

I am having trouble writing the code for this. Can anyone give me some suggestions or help out in any way?

**confused**

Beth
**Learning Access**
 
Sum an Immediate if statement where you create the value...

Sum(IIF(chkRegister = True, [REGISTRATION FEE] ,0)

You can read up on IIF in help... If you can't find it, be sure you have the VB help for Access installed.
 
I left off a parenthesis...

Sum(IIF(chkRegister = True, [REGISTRATION FEE] ,0))
 
If you are looking to put the totals on the same report as the other form, a seperate form is not needed. In the footer of the form add the fields you need
example sum([field name])

If you are looking for the sums to be a seperate form then I would recommend changing the record source on the new report to be a sum query of the recordsource for the detail report. Remember that the sum query will need to every field removed that you don't want to group on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top