Add Values In A Table

  • Thread starter Thread starter jonnytheboy
  • Start date Start date
J

jonnytheboy

Probably being a bit thick her but can't see the wood for the trees wit
this one...

I've got a table with 10 seperate percentages (it' a production recipe
and when a new record is added I need to verify that the total of thes
fields adds up to 100 before it can be saved.

Any help/suggestions greatly appreciated


-
jonnythebo
 
Probably being a bit thick her but can't see the wood for the trees with
this one...

I've got a table with 10 seperate percentages (it' a production recipe)
and when a new record is added I need to verify that the total of these
fields adds up to 100 before it can be saved.

Any help/suggestions greatly appreciated.

You're CRUEL to your users!!!

A Table Validation rule such as

Abs([Ingr1] + [Ingr2] + [Ingr3] + <etc> + [Ingr10] - 1.0) < 1.0D-10

would work; if the numbers are Double, you *will* get roundoff error
and it may be impossible to get the numbers to add up to exactly 1.

Note that THIS IS BAD TABLE DESIGN. If you have one recipe to many
ingredients, you should *not* have each ingredient in a field; you
should instead have two tables in a one to many relationship.
 
Back
Top