I have a form that updates to my table and I would like to have the form show my new balance after data entry. The table contains all of the accounts that are credits and/or debits.
My table was created from an Excel file that has totals for all credits and debits as well as my previous balance.
Balance from last entry = $1000
New Credits (+ #) = $ 200
New Debits (- #) = $ 300 shown as ($300)
New Balance = $ 900
I was successful in creating the Access Table. However, as you know the formulas are not created in Access.
I used "Got Focus Event" on my data entry form to add all of the credit fields and Debit fields with no problem. The codes are -
Private Sub Credit_GotFocus()
Credit = [BS] + [BFD] + [Dues] + [DON] + [CSMS] + [TAB]
Private Sub Debit_GotFocus()
Debit = [WAT] + [Rent] + [WPS] + [EHS] + [OPOX]
Now I want to show my running balance which would be - [Old Balance] + [New Credits] + [New Debits] = [New Balance].
Then, next entry becomes [Old Balance] + [New Cred...], well, I think you get the picture.
Private Sub NewBalance_GotFocus()
NewBalance = [Credit] + [Debit] + [????]
Where [????] equals the previous balance.
I can get the Credits and Debits added ok but how do I get the previous balance into the VBA. In my example I have reduced the balance by $100 (Credits + Debits = -$100)
I am not a complete noob but I am pretty close.
Any help please.