Calculate a Running Balance in a Microsoft Access Checkbook Register
Question details
Calculate each checkbook transaction's ending balance from deposits, withdrawals, and the preceding balance in Microsoft Access.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A checkbook register needs a running balance even when transactions share a date or are entered out of date order.
- Observed behavior
- The desired balance follows transaction date order, with the primary key breaking ties between transactions on the same date.
Check the table and field names, the opening balance, and whether transaction dates contain time values. The example uses tblCheckbook with a numeric primary key named ID, a date-only field named TransactionDate, and Deposit and Withdrawal fields.
Use DSum with the transaction date and ID
Use this approach to calculate a running balance in a query, including transactions entered out of date order.
The expression sums deposits minus withdrawals through the current transaction. It orders same-day transactions by ID; change the field and table names if yours differ.
The example assumes TransactionDate values contain no time and are not blank. It starts the balance at zero, so add a fixed opening balance to the expression if needed.
In Access, select Create > Query Design and add tblCheckbook. Add TransactionDate, ID, Deposit, and Withdrawal to the query grid.
In a blank Field cell, enter: RunningBalance: Nz(DSum("Nz([Deposit],0)-Nz([Withdrawal],0)","tblCheckbook","[TransactionDate] < #" & Format([TransactionDate],"mm\/dd\/yyyy") & "# OR ([TransactionDate] = #" & Format([TransactionDate],"mm\/dd\/yyyy") & "# AND [ID] <= " & [ID] & ")"),0)
Set Sort to Ascending for TransactionDate and ID, with TransactionDate to the left of ID in the grid. Select Run and check the balances against known transactions.

Track checkbook balances in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility. Move an exported checkbook register into WPS Spreadsheets to calculate balances with spreadsheet formulas; it does not fix or replace the Access database query.

Frequently Asked Questions
Why isn't sorting by ID alone reliable?
If an older transaction is entered later, it receives a higher ID and would appear after newer transactions. Sort by TransactionDate first and ID second to calculate balances in date order.
What happens when two transactions have the same date?
The expression includes same-day transactions whose ID is less than or equal to the current ID. This gives each transaction a consistent position within that date.
How do I include an opening balance?
Add the opening amount to the end of the RunningBalance expression in Query Design. Alternatively, record it as a transaction before the other entries, but don't do both.
What if my transaction dates include times?
The example assumes date-only values. If times matter, revise the criteria to compare the complete date and time, then use ID as the tie-breaker for identical timestamps.
Can I edit the running balance directly?
No. RunningBalance is calculated by the query. Edit the underlying deposits, withdrawals, or transaction dates instead; whether those fields are editable depends on the query.




