Updating form

workmad3

***** Slob
Local time
Today, 16:32
Joined
Jul 15, 2005
Messages
375
Is there a form function in VBA that i can put code that will mean it is run every time something is changed in the controls on the form or will i need to put the function call in on the afterupdate(or similar) function for each control on the form?
 
Use the BeforeUpdate event of the form, although we'll need further details to be more specific
 
ok.. what i have is a form with lots of controls(textboxes mainly) and a lot of them need calculated values in them. I need to keep them up to date if the values they depend on change.
 
hmm... im not the best at explaining things, so please bear with me.

I have a form for a quote system, and it has a lot of information that needs to be entered.

A lot of the information also has almost like 'default' values that depend on information entered earlier. I need a way of keeping these values up to date if they arent over ridden and the values they rely on change. this is all happening before i store the final values in the db. hope that helps clarify things
 
Pat Hartman said:
Storing calculated values is simply wrong in most cases. The calculations should be done in the query or in the form.

I strongly agree with Pat here.

There are few cases when you should store calculated values. In my opinion, you only need to store them when you retrieve them multiple times. To speed up data retrieval, or if the calculation is very complex. In all other cases:
Storing calculated value increases the size of your table and requires additional time to retrieve data when running queries. Not to mention, it is a drain on storage space and a waste of memory. And as pat said, sometimes things happen to your tables when they shouldn't. Someone could alter the calculated value and throw off everything.

Stay dynamic, be accurate.
 

Users who are viewing this thread

Back
Top Bottom