Sum the Total cost of Rework - Please help!!!!!

F

Fred's

I have the following feilds on my form and I will like to know how
if I enter 10hrs of rework man-hours at $12.00, I want that the total
cost appear in the total cost bound text field.
My problem is that I do not know how to do this, because the is
updated by a VBA code.

Here is my 3 Unbound text fields:

Rework man-hours
Hourly rate
Total cost

Thank you for helping me..
Fred's
 
G

Golfinray

Set the control source of the total cost box to =([rework man-hours]*[hourly
rate])
 
J

John W. Vinson

I have the following feilds on my form and I will like to know how
if I enter 10hrs of rework man-hours at $12.00, I want that the total
cost appear in the total cost bound text field.
My problem is that I do not know how to do this, because the is
updated by a VBA code.

Here is my 3 Unbound text fields:

Rework man-hours
Hourly rate
Total cost

Why are these *unbound*? I would think that this is information that you would
want to store permanently in your table rather than just the product!

As for storing the total cost, here's my blurb: 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.
 
F

Fred's

Why are these *unbound*? I would think that this is information that you would
want to store permanently in your table rather than just the product!

As for storing the total cost, here's my blurb: Storing derived data suchas
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.


Hi John,

Sorry for the late reply,

Can you provide an example of " redoing the calculation whenever you
need it"?

Thanks,
Fred's
 
J

John W. Vinson

Can you provide an example of " redoing the calculation whenever you
need it"?

Sure. Rather than having a table field named Total Cost in addition to the
fields Work Hours and Hourly Rate, just use the latter two fields in your
table. Don't store Total Cost at all, anywhere.

When you need to display the total cost, say on a Report, you can use a Query
with a calculated field:

Total Cost: [Work Hours] * [Hourly Rate]

That calculated field will use the values stored in your table, take a
microsecond or so to do the multiplication, and display the result on your
report.
 

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