Calculating a running balance

Posted on 2003-11-07
Medium Priority
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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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 …
Suggested Courses

765 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