How do I set the default value property of a field as the sum of .

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

Guest

Hi,

I have three fields say A,B,C in a table Table1....and I need the to set the
default value of the field C as the sum of the other two fields.
A: +[C] ???..(If u think this is right... well think again)
Any help would be greatly appreciated. :)

Rehan Razak
 
You can't, nor should you.

If field A is always the sum of fields B and C, it shouldn't be stored in
the table. Instead, you should create a query that calculates it and use the
query wherever you would otherwise have used the table.

If you simply want A to default to B+C, but have the ability to overwrite
it, you'll have to use a form to do your updates. In the AfterUpdate event
of the textbox mapped to fields B and C, put logic to check whether both
fields have been defined, and update the value of the textbox mapped to
field A.
 
Back
Top