Access Table Design

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.
 
J

John W. Vinson

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!
 
J

Jeff Boyce

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
 
A

Armen Stein

Third Normal Form or Boyce-Codd Normal Form depending on who you talk to.

Unless it is truly a *default* (OP's wording) that could be changed
later. Then even Codd would probably be okay with it. :)

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
D

Duane Hookom

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!
 
J

Jeff Boyce

**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
 

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