Cumulative row function?

INFOS

Registered User.
Local time
Today, 22:14
Joined
Jan 15, 2005
Messages
55
How to make calculated field that represents cumulative row?
For example – table has fields "transaction_number", "trans_date" and "trans_amount".
In this table I register money transactions on my bank-account. I need calculated field that is going to show how much money is on my account after every transaction.

Thanks
 
Never store calculated fields in a table. Use a query.

Remember that in 99.9+% of the time, you can use a query any place you can use a table.

In the query, if you have fields A, B, and C, you can have a column that is A+B+C, no sweat.
 
If I understand you right, these are item lines in your bank account?

My initial thought would be to use a subform a view of each item line and make this a continuous form, then you can put a sum in the form footer to give to a running total each time an item line is added into the table.

Hope I have explained it well enough,

Brett
 
reply-more informations

I don't wont a field in a table - I need calculated field ona report.
I need this field in every row - every row (record) is one transaction and after every transaction there is new amount of money on the account. I need this amount for every transaction - not just total for this moment.
Here's the example of a 3 transactions and "cumulative field" -that I need:

trans_number / trans_date / trans_amount / cumulative_field
1 / 01.05.2005. / 1000 / 1000
2 / 02.05.2005. / 200 / 1200
3 / 02.05.2005. / 500 / 1700
4 / 03.05.2005. / -100 / 1600
5 / 03.05.2005. / 400 / 2000

So, I don't want to store this cumulative field in a table - can I have it as a calculated field? Is there function for this?
 
There is such a thing as a running sum, which you can do in a report. Let the wizard build the report for you and it will offer to include sums. Take it up on the offer. Then you can play with the settings for running sums.
 
Reply for the docman - it is not it

I did not find any "running sum" when I tryed with report wizard. It has only summing for every row but I need values of records before actuall row to be added to the value of the actuall row - and I need that for every row.

So, I don't need this:
trans_number / trans_date / trans_amount / cumulative_field
1 / 01.05.2005. / 1000 / 1000
2 / 02.05.2005. / 200 / 200
3 / 02.05.2005. / 500 / 500
4 / 03.05.2005. / -100 / -100
5 / 03.05.2005. / 400 / 400

or this:
trans_number / trans_date / trans_amount / cumulative_field
1 / 01.05.2005. / 1000 / 2000
2 / 02.05.2005. / 200 / 2000
3 / 02.05.2005. / 500 / 2000
4 / 03.05.2005. / -100 / 2000
5 / 03.05.2005. / 400 / 2000

but I need this:
trans_number / trans_date / trans_amount / cumulative_field
1 / 01.05.2005. / 1000 / 1000
2 / 02.05.2005. / 200 / 1200
3 / 02.05.2005. / 500 / 1700
4 / 03.05.2005. / -100 / 1600
5 / 03.05.2005. / 400 / 2000

And if you turn the order of records then cumulative_field values changes into this:

trans_number / trans_date / trans_amount / cumulative_field
1 / 01.05.2005. / 1000 / 1000
5 / 03.05.2005. / 400 / 1400
2 / 02.05.2005. / 200 / 1600
4 / 03.05.2005. / -100 / 1500
3 / 02.05.2005. / 500 / 2000

So as you can see value of the fields isn't connected with the specific record (row) but it depends of the order of records.
 
Running sum is a property of a control in a report for which you have an aggregate function defined. You have to create the control and then get into its properties.

The report wizard should have given you the option, when defining the fields you wanted to see, to also see summaries of those fields. Unless that particular wizard has changed in a version of Access I don't have. If so, I can't help you that much more 'cause I can't reproduce the problem.
 
Add an unbound textbox, set its control source to =[trans_amount], set the running sum property to OverAll or OverGroup
 
Thanks, Rich. I can never remember where that goes and I don't always have Access open when I "shoot from the hip."
 

Users who are viewing this thread

Back
Top Bottom