Updating calculations in a form

Jmsteph

Registered User.
Local time
Today, 12:15
Joined
Dec 2, 2008
Messages
28
Hello,

I know this is a dumb question, but I have learned access through the school of hard knocks. There for I have missed some really easy things. I have a form that I need the "total" text box to update based on what is placed in the "other" text boxes. This update update each time you change the field in the current like an excel sheet. I am assuming I'll have to use VBA, but would really appreciate some help geting started. I am running on 2003 if that matters.
Thanks,

JS
 
Is your form bound to a table/query, and do you have a Continuous Form? If so, add a TextBox Control to the Footer Section with the Control Source: =Sum([ControlName]), where ControlName is the name of the repeating TextBox Control in the Detail Section to add up. Otherwise, please describe how you have your form setup.
 
You can have unbound textboxes feed of each other just like you do with cells in Excel. As you can see from fdcusa's post you even have the =

However, sometimes it is better to have the calculations done by caluclated fields in a query. In my experience when you have lots of unbound textboxes with formulas they bog down.

Another negative of unbound etx boxes with formulas as compared to calculations done in a query is there is a delay the for the result to show. This causes problems if you have code or a macro open a form and you want the value on the form being opened to transfer to the main form with a SetValue action. Nothing will transfer because the stvalue is too fast for the unbound textbox.

To make calculated fields in a query you go to Design view and type the new field name followed by a colon and the formula as follows

NewFieldName:[Products]/[Price]
 

Users who are viewing this thread

Back
Top Bottom