Guys,
I have a table (tblMoney) with the following fields and values:
fldCode :: fldDate :: fldValue
1 :: 03/15/2011 :: 100.00
2 :: 03/17/2011 :: 40.00
3 :: 03/19/2011 :: -20.00
4 :: 03/21/2011 :: 15.00
5 :: 03/16/2011 :: -30.00
6 :: 03/18/2011 :: 200.00
7 :: 03/20/2011 :: -60.00
8 :: 03/22/2011 :: -10.00
fldCode is an AutoNumber field.
fldDate is the date when the values were paid or received.
fldValue is the amount of money (debits and credits).
As you can see, values are not necessarily input in a chronological order. They are input randomly, when it comes to dates. But the fldCode follows an ascending order, of course, because it is automatic.
I need a continuous form (frmMoney) with the following layout:
Date :: Value :: Balance
03/15/2011 :: 100.00 :: 100.00
03/16/2011 :: -30.00 :: 70.00
03/17/2011 :: 40.00 :: 110.00
03/18/2011 :: 200.00 :: 310.00
03/19/2011 :: -20.00 :: 290.00
03/20/2011 :: -60.00 :: 230.00
03/21/2011 :: 15.00 :: 245.00
03/22/2011 :: -10.00 :: 235.00
fldCode is present in the form, however it is hidden (no need to be shown).
Records must be sorted by ascending date, of course, otherwise the balance would not make any sense.
If there is more than one record with the same date, fldCode can be the second sorting option. (But that does not really matter.)
And now, my doubt is... how can I have all of this?
- The table is ready.
- There is a query (qryMoney) based on that table, just to sort the records in ascending order of date, nothing else. (Is it necessary?)
- The continuous form is based on that query and it is partially ready, I mean, I have already made the layout. That is all.
What I really do not know is how to get that balance field to work. I have no idea what to do. Please, help me.
Thank you very much for your attention.
brunces