Calculate Loan Balances and Deduct Payments in Microsoft Access
Question details
Calculate each loan's remaining principal from its original amount and recorded principal payments without storing a changing balance.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A loan database has a loans table and a separate payments table, with payments linked to loans by LoanID.
- Observed behavior
- The desired balance updates when payment records are added or changed, without duplicating the balance in a table.
Check that tblLoans has a unique LoanID and an OrigLoanAmt field, and that tblPayments has LoanID and PrincipalPmt fields. Use the principal portion of each payment, not any interest or fees, and adjust the names in the queries if your fields differ.
Calculate the balance with two Access queries
Use a payment totals query and a balance query to calculate the remaining principal for every loan, including loans with no payments.
This calculation subtracts all recorded principal payments from the original amount. It does not calculate interest, fees, or a balance as of a specific date.
In Access, select Create > Query Design, switch to SQL View, and enter: SELECT LoanID, Sum(PrincipalPmt) AS PmtTotal FROM tblPayments GROUP BY LoanID;
Select Save and name the query qryPayments. Run it to check that each LoanID has the expected principal payment total.
Select Create > Query Design and switch to SQL View. Enter: SELECT tblLoans.LoanID, tblLoans.OrigLoanAmt, Nz(qryPayments.PmtTotal, 0) AS TotalPaid, tblLoans.OrigLoanAmt - Nz(qryPayments.PmtTotal, 0) AS Balance FROM tblLoans LEFT JOIN qryPayments ON tblLoans.LoanID = qryPayments.LoanID;
Save the query, then select Run. Add a principal payment to tblPayments and rerun the balance query to verify that the balance decreases.

Review exported loan data in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility. Export loan data from Access to Excel to review it in WPS Spreadsheets; WPS does not run Access database queries.

Frequently Asked Questions
Why isn't a loan with no payments showing in my query?
An INNER JOIN excludes loans without matching payments. Use a LEFT JOIN from tblLoans to qryPayments and Nz(qryPayments.PmtTotal, 0) to show a zero payment total.
Should I subtract the entire payment from the loan amount?
Only subtract the principal portion when calculating remaining principal. Record interest and fees separately so they are not included in PrincipalPmt.
Does the balance update when I add a payment?
Yes. Add the payment to tblPayments with the correct LoanID, then rerun the balance query to see the recalculated result.
Can I use this query to calculate interest?
No. The query subtracts recorded principal payments from the original amount. Interest requires additional fields and calculation rules.




