how to keep a running balance using calculated controls?

S

SamwiseGamgee

I have a Transactions database. The fields are TransactionId
TransactionType, and TransactionAmount.

The data entry for TransactionType are,
Deposit
Withdrawal
Purchase
Payment

I have a main form and subform. The subform's RecordSource="select
from Transactions". The subform's Default View is Datasheet.

I would like to keep a running balance on the main form, based o
records in the subform

One can add, delete, or edit transactions on the subform. A Deposi
would add to the running balance. A Withdrawal, Purchase, or Paymen
would subtract from the running balance.

I know how to get a total or sum of TransactionAmount from the subform
Use a Text Box control in the footer and assign Contro
Source=Sum([TransactionAmount]) Then assign that control to a text bo
control on the main form

What I don't know how to do and would definitely appreciate much hel
on is,

1. get a sum of Desposit from the records in the subform
2. get a sum of Deduction (of Withdrawal, Payment, and Purchase) fro
records in the subform
3. get balance from Deposit - Deduction

I would like to use calculated controls for 1 and 2, but I'm totall
stumped, I don't know what to put in for the Control Source.

Thank you in advanced!

(Or, is there an easier way of doing this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top