BOUNDING A RESULT OF A TEXT BOX

S

scubadiver

It is never necessary to put "on-the-fly" calculations directly into a
table. Why should you want to?
 
J

John W. Vinson

How do I get a value (sum) from a text box on a form to a field in a table?

Generally... You don't.

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.

If you can explain why you feel that you need to violate this principle post
back - it is possible to do so, it's just generally a Bad Idea.

John W. Vinson [MVP]
 
G

geeves1293

I have a form with a subform. The subform has a sum text box in the footer
which is totallying the line totals in the detail of the subform. There is
another text box in the main form connected to the text box in the subform
footer showing the output.

What I need is the total of each form (order) on a listing report, showing
me all my 'order book' totals, then give me a complete total of my 'order
book'.

Overview:
1 Line Total (that takes the qty * unit price) - in the detail of subform.
2 Order Total (that sums all the line totals) - in the footer of subform.
3 Order Total Output (same as the order total) - on the main form.
4 Order book Line total (Order Total from each subform) - in order book
report.
5 Order book Total (The sum total of the Order book Line Totals) - in order
book report.

I already have 1 - 3. Just got a bit stuck on 4. Number 5 should be quite
easy enough once 4 is complete.

Thanks very much.

Geeves1293
 
Top