Formula between two fields in a Table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey

I'm new tot Acces - I think this should be simple but I cant figure it out...

In a table/form...

I have one field: Charge
I have another field: Payment
I have a third field: Balance

I want the Balance field to automatically calculate "Charge" MINUS "Payment".

Thanks!!!!!!!!!!!1

Jesse
 
Jesse said:
Hey

I'm new tot Acces - I think this should be simple but I cant figure it out...

In a table/form...

I have one field: Charge
I have another field: Payment
I have a third field: Balance

I want the Balance field to automatically calculate "Charge" MINUS "Payment".

You are doing what we call "committing spreadsheet". A database is not a
spreadsheet and you will have no end to problems if you try to make it act like
one.

In a spreadsheet, the Balance would not be a stored value but rather an
expression would be entered to perform the calculation on the fly. Change
either of the two operands and the balance automatically reflects the new
result. Same concept applies here. You "store in your table" only the operands
and you do the calculation on the fly for the balance. That way you never have
to worry about the balance value being incorrect.

You can make this on the fly calculation in a query, form, or report. If you
create a query based on your table (from which you have removed the field for
Balance) and add a calculated field for Balance to the query you can now base
all forms and reports on the query so you only have to write the expression one
time.
 
Hi Jesse,

It's probably because you haven't yet reached an understanding of the
differences between a spreadsheet and a relational database. Your attempt
to do things in a table is "spreadsheet think". Note that the thing that
Excel calls a database is simply a small section of a spreadsheet that
behaves like a table.

In Access the calculations you're trying to perform are done in queries,
forms and reports but never in tables.

HTH
 

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