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
|
|||
|
|||
Running Total
Hello!
I have a subform F_Score in datasheet view on a Form F_Dates. The linking field is dates. So for each date, there is the F_Score subform and it has several boxes including Score and Total Score. A new score is entered several times throughout the day, and I want the Total Score to be updated every time a new score is added. Thus Total Score would be the new score plus the old Total Score, Or it could be the new score plus all the Scores for the day. I know this is probably a really simple thing to do, but I don't know how to do this for a datasheet which constantly has new records being added. This is such an easy thing, and I'm making it sound more confusing than it is. I hope you understand what I'm trying to say. Thank you in advance! |
#2
|
|||
|
|||
Running Total
Hi,
If I understand you right .. you want the total score to be shown in the datasheet-viewed sub-form .. in that case all you need do is set the Control Source property for the total score field to Sum([F_Score]). This will always show the total of the F_Score fields displayed in the datasheet. HTH MFK. "Kristen" wrote in message ... Hello! I have a subform F_Score in datasheet view on a Form F_Dates. The linking field is dates. So for each date, there is the F_Score subform and it has several boxes including Score and Total Score. A new score is entered several times throughout the day, and I want the Total Score to be updated every time a new score is added. Thus Total Score would be the new score plus the old Total Score, Or it could be the new score plus all the Scores for the day. I know this is probably a really simple thing to do, but I don't know how to do this for a datasheet which constantly has new records being added. This is such an easy thing, and I'm making it sound more confusing than it is. I hope you understand what I'm trying to say. Thank you in advance! |
#3
|
|||
|
|||
Running Total
Thanks, Michael. This is working...sort of. It is
calculating the total, but updates it for all entries. Ideally, what I would like is for it to total the first score. Then the next total would be the first and second score. Then the next total would be the first, second and third score and so on. So that I can see what the total is at each phase. What it is doing now is putting the same number in all of the total fields. For example, I want it to do this: Score 10 Total 10 Score 30 Total 40 Score 50 Total 90 .. .. .. Any ideas? -----Original Message----- Hi, If I understand you right .. you want the total score to be shown in the datasheet-viewed sub-form .. in that case all you need do is set the Control Source property for the total score field to Sum ([F_Score]). This will always show the total of the F_Score fields displayed in the datasheet. HTH MFK. "Kristen" wrote in message ... Hello! I have a subform F_Score in datasheet view on a Form F_Dates. The linking field is dates. So for each date, there is the F_Score subform and it has several boxes including Score and Total Score. A new score is entered several times throughout the day, and I want the Total Score to be updated every time a new score is added. Thus Total Score would be the new score plus the old Total Score, Or it could be the new score plus all the Scores for the day. I know this is probably a really simple thing to do, but I don't know how to do this for a datasheet which constantly has new records being added. This is such an easy thing, and I'm making it sound more confusing than it is. I hope you understand what I'm trying to say. Thank you in advance! . |
#4
|
|||
|
|||
Running Total
Hi,
Well .. the best I can come up with at short notice .. and not knowing very much about your DB is .. if you keep the total score in the scores table, then you can add a procedure, something like: Private Sub ScoreValue_BeforeUpdate(Cancel As Integer) Me.ScoreTotal = DSum("[ScoreValue]", "tblScores", "[Score Date] =" & Date) + Me.ScoreValue End Sub to the before update event of the F_Score field .. this will add the score just entered to the total. The "[Score Date] =" & Date part is supposed to be the "Where" clause that you use to populate the datasheet of scores. I hope this is clear enough for you to work from :-) MFK "Kristen" wrote in message ... Thanks, Michael. This is working...sort of. It is calculating the total, but updates it for all entries. Ideally, what I would like is for it to total the first score. Then the next total would be the first and second score. Then the next total would be the first, second and third score and so on. So that I can see what the total is at each phase. What it is doing now is putting the same number in all of the total fields. For example, I want it to do this: Score 10 Total 10 Score 30 Total 40 Score 50 Total 90 . . . Any ideas? -----Original Message----- Hi, If I understand you right .. you want the total score to be shown in the datasheet-viewed sub-form .. in that case all you need do is set the Control Source property for the total score field to Sum ([F_Score]). This will always show the total of the F_Score fields displayed in the datasheet. HTH MFK. "Kristen" wrote in message ... Hello! I have a subform F_Score in datasheet view on a Form F_Dates. The linking field is dates. So for each date, there is the F_Score subform and it has several boxes including Score and Total Score. A new score is entered several times throughout the day, and I want the Total Score to be updated every time a new score is added. Thus Total Score would be the new score plus the old Total Score, Or it could be the new score plus all the Scores for the day. I know this is probably a really simple thing to do, but I don't know how to do this for a datasheet which constantly has new records being added. This is such an easy thing, and I'm making it sound more confusing than it is. I hope you understand what I'm trying to say. Thank you in advance! . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
running total for a form | running total in a form | General Discussion | 1 | June 17th, 2004 05:00 AM |
calculate a running total | Rick | Setting up and Configuration | 1 | March 30th, 2004 12:17 PM |
Using A Pivot Table Running Total in a Pivot Table Formula | bmanville | Worksheet Functions | 0 | February 18th, 2004 10:40 PM |
Searching a column multiple times for a value / returning a running total of values | Jeff King | Worksheet Functions | 0 | December 8th, 2003 05:17 PM |
Running Total Chart question | Neil Grantham | Charts and Charting | 6 | October 26th, 2003 04:03 PM |