What events to use ?

cheer

Registered User.
Local time
Today, 23:20
Joined
Oct 30, 2009
Messages
222
Attachment below show the total price comprised of few parameters. I already create a function to store the formula as shown in the attachment. The function name is CreateTotalPrice.

My questions are following
a) What object events I need to use to call the above function ?
b) Any changes to the Total CT at the sub-form will affect the total price. How to write this call ?

Anyone can assist ?
 

Attachments

  • Total Price.JPG
    Total Price.JPG
    89.8 KB · Views: 91
There's no need to store the total price and it is generally considered bad practice to do so (at least in a relational design). Instead, just use the formula whenever you need to e.g. in the text box you are working on.

The reason why it is not a good idea to store the result is because you are storing redundant information i.e. information that can easily be derived from other information already stored. Also, it raises the potential for inconsistency. Someone might realise that the hour rate was wrong and so update all the hour rates for all records. But they didn't realise that there was another field that needed to be updated as a consequence and so the information becomes inconsistent.

hth
Chris
 
Look at "DemoTotalPriceA2000.mdb" (attachment, zip).
Look at tables, forms (the field "Total Price (RM)", Control Source
properties. Try to change any field included in the formula.
Try to enter a new record.
Open frmMainForm and try.
 

Attachments

Users who are viewing this thread

Back
Top Bottom