Expression back to table

G

Guest

I'm using an expression on a form to calculate totals. On the table which is
the record source for the form there is a column marked "Total". Of course
when you put an expression in a text box on a form the results of the
expression will not show up back in the table. If you remove the expression
and just enter a total the table reflects the amount. I'm stumped. So Far I
have tried using a default value in the text box properties and in the field
arguement in the table. That didn't work. I also tried several variations of
expressions in a query builder for the form. That either did nothing or
messed up my other fields on the form. I also looked into using a "set value"
in a macro, but I don't believe that would work. It's probally a simple
solution to a simple problem but I'm missing something or entering a value
wrong somewhere. If anyone could help me with this it would be greatly
appreciated. The field name is Total, the expression I have in the Text box
on the form is =TotalB4Tax+tax1. As you can see I have a couple other
expressions for input. If I can get this one to work I should be able to get
the others.....Thanks Lyndac
 
J

John Vinson

I'm using an expression on a form to calculate totals. On the table which is
the record source for the form there is a column marked "Total".

There shouldn't be such a column.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.

John W. Vinson[MVP]
 

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