Balance Sheet

  • Thread starter Thread starter Celi
  • Start date Start date
C

Celi

I have a form like this:

credit | debit | balance

100 0 100
0 250 150
0 50 200

what code sould I use to get the described results in the
balance field?

Thank you
 
You will need some way to identify how the records are sorted so you can
calculate the balance.

This example assumes you have an AutoNumber field named "ID", and that
Credit and Debit are required fields (i.e. they cannot be Null). Set the
Control Source of the Balance text box to:
=DSum("[Credit] - [Debit]", "NameOfYourTableHere", "ID <= " & Nz(Me.[ID],
0))

Note that this will be slow.

You can do this very simply in a report, by setting the RunningSum property
of the text box.
 

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

Back
Top