using a function w/table field to enter default in another field

T

trex

I have a table field for a date. I want to use that field and do a sum
function to enter default into another table field automatically based on the
date in the source field.
I use the following Sum([old]+60)
old is the table field with the date adn the new field is to be 60 days
after source field.

I do not get a syntec error, however I get "database engine does not
recognize either teh field 'old' in a validation expression, or the default
value in the table..."

please advise
 
D

Douglas J. Steele

Relational Database Theory says that it's a mistake to have one field in a
table be strictly determinable from the value of another field (or fields)
in that same table, hence Access doesn't allow it. In general, it's
considered a bad idea to store calculated fields. As fellow MVP John Vinson
likes to say "Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost any calculation
will be MUCH faster than a disk fetch); and most importantly, it risks data
corruption. If one of the underlying fields is subsequently edited, you will
have data in your table WHICH IS WRONG, and no automatic way to detect that
fact."

Simply add a computed field in a query that figures out the date, and use
the query wherever you would otherwise have used the table.
 

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