Calculated field plus previous record

  • Thread starter Thread starter Kon
  • Start date Start date
K

Kon

I have a debit and a credit and I want a calculated field named residual
(debit - credit). The field residual I want to be (credit-debit)+residual
previous record. How can I do this.
(I tried a custom function using form.recordset but I couldn't use it
because every time I go to next
record recalculated the residual and and mixed up. Any suggestions or any
code in web site?
 
Kon said:
I have a debit and a credit and I want a calculated field named residual
(debit - credit). The field residual I want to be (credit-debit)+residual
previous record. How can I do this.
(I tried a custom function using form.recordset but I couldn't use it
because every time I go to next
record recalculated the residual and and mixed up. Any suggestions or any
code in web site?

Unless I'm missing something, surely for any given record the residual is
simply the sum of debits and credits on ALL of the records? If you want to
display this in a form, you could use Dsum:

=DSum("[debit]-[credit]", "my_table")
 
Back
Top