Calculating a running balance

Posted on 2003-11-07
Last Modified: 2009-12-16
How do you calculate a running balance in MS ACCESS Form i.e  if I want to creat a running balance for customer's daily purchase on credit.
Question by:HANKNO
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

svenkarlsen earned 50 total points
ID: 9704559
if you have the customer account table with e.g. a record for each purchase/transaction:

Table: CustTrans
Fields: CustID, Transdate, TransAmmnt

And then you have another table which sums up the first:

Table: DailyBalance
Fields: CustID, BallDate, BallAmnt

Then you can run a query every day (e.g. at midnight):

INSERT INTO DailyBalance ( CustID, BallAmnt, Balldate )
SELECT CustTrans.CustID, Sum(CustTrans.TransAmnt) AS SumOfTransAmnt, Date() AS CurrDate
FROM CustTrans
WHERE (((CustTrans.Transdate)<Date()))
GROUP BY CustTrans.CustID;

Of course this is just a synopsis, - in the real world you must code the errorhandlers, think about exceptions, probably adapt the query so it can be run at any date (not just current). But it'll get you by for starters, - notice that it gets the Customer list from the trans-table: this means than any client who has made a transaction will be included automatically, - i.e. you don't have to add new clients to the DailyBallance table.

LVL 39

Expert Comment

ID: 10025047
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: svenkarlsen {http:#9704559}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question