Field Calculation

F

formcreator

Hi,
In one of the fields in my table how do I calculate the difference
between total number of records and the current record.

For ex. If there are 6 records the value in one of the columns in the
current record I want to be able to calculate the follwoing

(6-BP_Rank)

BP Rank is a field in the table.

Thanks
 
J

Jeff Boyce

You don't!

Instead of trying to add a calculated value/field into your table, consider
using a query to generate the calculated value only when/as needed.

That said, there are a few (rare) situations in which it might be necessary
to save a calculated value, but rank-ordering seems like something that
would change every time a new row was added (hence, a dynamic, query-based
calculation).

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

formcreator

Thanks Jeff,
But how do I add a calculated field in my table. I do not know Access
that well. Can you please help me.

Shri
 
A

Al Campagna

Jeff,
You don't add a calculated field to your table. The calculation is done
"on the fly" using fields you have already saved to the table.
An common example would be...
Price * Qty = Line Total
You would not have a LineTotal field in your table.

Since you capture Price and Qty to the table, you can always "re-derive"
the LineTotal in any form, query, or report, by using a "calculated" field.
So... an unbound calculated text control on your form, with a
ControlSource of...
=Price * Qty
will always "display" the correct LineTotal.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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

Top