Function in Table

A

Anthony

I have a question, can you set up a table to automatically add or subtract
two fields in that table. I have two currency values and I want the one to
subtract the one value from the other if it is higher than the one and if it
is not then I want it to add. Is there anyway that it can happen, please let
me know. Thanks
 
J

Jerry Whittle

In a word: No.

However you can do this in a query, form, or report as needed. That's
usually the best way to handle this.
 
D

Douglas J. Steele

Fields in tables cannot contain functions. Moreover, it's generally not
recommended to store calculated values in tables.

Create a query, and put a computed field in that query:

MaxValue: IIf(Nz([Field1], 0) > Nz([Field2], 0), Nz([Field1], 0), [Field2])

Use the query wherever you would otherwise have used the table.
 
Top