Calculated Field

christshis

Registered User.
Local time
Today, 17:14
Joined
May 24, 2006
Messages
14
Hello Guys,

I am trying to do the following in a form.
1) (Travel hours + work hours) * dollarperhr to get the "Total" bill to a customer.

2) The results will be put in a field "TotalDollars" that is a part of a table.

Please help.

I tried to put an event (on change) on the "dollarperhr" box so that after entering the values in "travel hours" + "Work hours" * "dollarperhr", the calculation will be done to populate "TotalDollars", but it didn't work.

please help
 
The rule is that if you can calculate a value, you don't store it in a table... just perform the calculation when required.
 
MStCyr said:
The rule is that if you can calculate a value, you don't store it in a table... just perform the calculation when required.

This is only mostly correct. The real rule is, you do whatever produces the best results e.g. (low processing usage, low bandwidth usage, minimal retrieval time, minimal storage space) - these "best results" are normally grouped together.

Some differences do exist, though, when you may need to side with one performance scenario over another. For instance, it would be beneficial for storage space to only perform the calculation when the number is needed. But what if it is a large calculation? You're sacrificing processor cycles and retrieval time in order to minimize disk space. If this is a once-in-a-while calculation, then you dont need to store it, but if you're pulling this number all the time and can afford the space... store it.

Though, you have to be careful though with how this number is used and how you can check if it is updated. If its a static calculation (the numbers don't change), there is little worry, but data integrity issues are important to keep in mind.

-----------------------------------------------------

Now to answer the original question, in order for us to tell you what you're doing wrong, you must better describe what you did. Is the form based on the table, if so you don't need to update the table (updating the form's field should be sufficient). If it is not based on the table, please display your code and what you are doing.
 
Last edited:
Modest and MStCyr,
This issue seems to be resolved on the other thread.
 

Users who are viewing this thread

Back
Top Bottom