I am trying to get/calculate a previous balance in a query (based on a table named File) that gets its criteria (an Account No) from a form to create the record set. I have to do calculations on the interest to be paid for the duration of the time between transactions. My record set is consecutively numbered and I use the following code:
PrevBalance: DLookUp("NZ([CurrentBalance],0) ","File "," [File]![TransactionNo] =" & [File]![TransactionNo]-1)
to get the previous balance and then calculate the current balance as:
CurrentBalance: NZ([PrevBalance],0)+NZ([Deposit],0)-NZ([PrincipalPd],0)
I get the starting current balance from the above - it is entered as a deposit. Current balance and PrevBalance are NOT fields in my table
I get weird numbers, HELP!@!!
PrevBalance: DLookUp("NZ([CurrentBalance],0) ","File "," [File]![TransactionNo] =" & [File]![TransactionNo]-1)
to get the previous balance and then calculate the current balance as:
CurrentBalance: NZ([PrevBalance],0)+NZ([Deposit],0)-NZ([PrincipalPd],0)
I get the starting current balance from the above - it is entered as a deposit. Current balance and PrevBalance are NOT fields in my table
I get weird numbers, HELP!@!!