Updating fields in a subform record

I have a subform in Access bound to a table.  The subform has several columns that are enabled and several that are not enabled.  All of the columns are bound to fields in the table.  When exiting a record in the subform I want to update the columns that are not enabled based upon data entered in the enabled columns.  What event should I do this on?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
That will happen automatically.
dsoderstromAuthor Commented:
The unenabled columns would update automatically if the Control Source for them was a formula but it's not.  They are bound to fields in the table.  Their value will be determined by what gets entered in several of the enabled columns.
I can put code behind the After Update event of the enabled columns involved in the calculations but I have to put the same code behind each one of them .  I thought it would be easier to do the calculations for all unenabled fields all at once when exiting the record after all enabled fields have been entered.  But, if running the calculations on the After Update event of each field is the only way to do it then I can do it that way.
Gustav BrockCIOCommented:
I see. You should put your update code in the BeforeUpdate event of the form.
Chances are excellent that you should not be storing the calculated values anyway.  They should be calculated in the query.  In that case, Access will automagically update the calculated columns when you change the data.  That way you'll see the values immediately.  Your present method and Gus' suggestion won't show the values until you leave the record.  Check out Normalization and pay attention to the first three normal forms so get some understanding of why storing calculated values is a violation.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dsoderstromAuthor Commented:
Thanks guys for straightening me out.  After looking at this a little more I realized that i really do not need to store the calculated values.  I created my own problem by including them in the table and making them bound fields in the form.  I appreciate the help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.