If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
sum function on forms in access
I'm using access 2003. i've created a form for recording monthly donations
which includes 12 field for Jan - Dec. I want a box or field for 'year-to-date' to have a running total of donations for each donor. it seems easy enough -.... my thought was =sum([jan]+[feb]+[mar]...) so forth.... this doesn't seem to work. where am i going wrong? ps - I am a newbee - bear that in mind - THANKS! Newbee. |
#2
|
|||
|
|||
Remove the sum.
Try =[jan]+[feb]+[mar]...+[dec] -- Allan Murphy Email: "newbee" wrote in message ... I'm using access 2003. i've created a form for recording monthly donations which includes 12 field for Jan - Dec. I want a box or field for 'year-to-date' to have a running total of donations for each donor. it seems easy enough -.... my thought was =sum([jan]+[feb]+[mar]...) so forth.... this doesn't seem to work. where am i going wrong? ps - I am a newbee - bear that in mind - THANKS! Newbee. |
#3
|
|||
|
|||
On Mon, 5 Sep 2005 13:58:06 -0700, newbee
wrote: I'm using access 2003. i've created a form for recording monthly donations which includes 12 field for Jan - Dec. Then your table is incorrectly designed. What will you do next January? Scrap your database and start over? You have a one (donor) to many (donations) relationship. The proper way to manage a one to many relationship is with TWO tables, e.g.: Donors DonorID LastName FirstName other bio information Donations DonorID same datatype as DonorID, Long Integer if that's an Autonumber DonationDate Amount You'ld add a new RECORD (using a Subform) into Donations for each donation from the donor. I want a box or field for 'year-to-date' to have a running total of donations for each donor. it seems easy enough -.... my thought was =sum([jan]+[feb]+[mar]...) so forth.... this doesn't seem to work. where am i going wrong? ps - I am a newbee - bear that in mind - THANKS! The Sum() function sums values in the SAME field across MULTIPLE records. If you just want to add up the values in your non-normalized monthname fields, you need to allow for the possibility that one might be blank (NULL); any expression involving NULL returns NULL. The getaround is to use the NZ (Null To Zero) function: =NZ([Jan]) + NZ([Feb]) + NZ([Mar]) + ... With the normalized table structure, with one record per donation, you can indeed use the Sum() function; in your subform's Footer put a textbox with COntrol Source =Sum([Amount]) John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2002 vs 2003 | Patrick Stubbin | General Discussion | 2 | May 17th, 2005 07:27 AM |
The "Right" web hosting for data access pages?? | Ron Ehrlich | General Discussion | 9 | May 6th, 2005 05:49 AM |
Encrypt AccesS File? | milest | General Discussion | 2 | February 9th, 2005 07:58 PM |
Access Error Message when opening database | eah | General Discussion | 3 | January 26th, 2005 10:04 AM |
Access XP Compared to Access 2003 | Mardene Leahu | New Users | 1 | October 1st, 2004 05:11 AM |