Access Table Design

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

In Access table design is it possible to set the default value on a field
referencing the value to another field in the same table. For example field
A and field B, if field A is 1 can I set the default value of field B =
field A + 1 and in this case field B should be 2. Thanks.
 
In Access table design is it possible to set the default value on a field
referencing the value to another field in the same table.

No, it is not. The default value is assigned the instant the new record is
created - at which time no other field can possibly have any data.

You can use a Form, and use the AfterUpdate event of FieldA's control to set
the value (or the DefaultValue property) of the control bound to FieldB. You
should be using forms to enter data in any case so this shouldn't be much of a
burden!
 
Paul

One of the principles of normalization speaks about not having a second
field dependent on a first (I can never remember which # that one is).
After all, using your example, if you know the value of FieldA, you
automatically know the value of FieldB... so why bother saving a value in
FieldB when you can simply calculate it from the value in FieldA?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Maybe Codd would be okay with it but I'm not sure about (Jeff) Boyce ;-)

If anyone has a good understanding of Boyce-Codd, it should be someone named
Boyce. Just don't ask Duey Hookom how to catch trophy fish!
 
**DISCLAIMER**

The "Boyce" of "Boyce-Codd" fame is no relation ... or at least none that
I'm aware of or wish to claim.

Regards

Jeff Boyce
 
Back
Top