Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated field not updating

Status
Not open for further replies.

ohmbru

Technical User
Jul 13, 2001
161
US
I have a calculated field on my form which sums 4 fields. The sum is not displayed until data is entered in one particular field. I believe this is the last field I added to the DB. I would like the calculated field to keep a running total and display the current total no matter what field I begin entering data. Any suggestions?

Thanks,
Brian
 
Discribe your calculation field, what is the calculation formula? Who takes 7 seconds to develop,
7 mins to document,
7 hours to test,
7 months to fix will always blame the clock. s-)
 
I'm calculating them this way:

=[field1]+[field2]+[field3]+[field4]

I have tried calculating this way in the query the form is based on and the form itself. Brian
 
Ok, place your formula in the controlsource property of your Total field. Each any of the numbers is changed, your total field will reflect the change.

Good luck!

Who takes 7 seconds to develop,
7 mins to document,
7 hours to test,
7 months to fix will always blame the clock. s-)
 
The formula is already in the control source property.

The total field does update when I change the value of [field3] Brian
 
Check the format of all the fields, are they numerically formatted versus textual, (the default is text).

Who takes 7 seconds to develop,
7 mins to document,
7 hours to test,
7 months to fix will always blame the clock. s-)
 
Have you tried setting up on all 4 fields' afterupdate procedure to requery the total field in VB Code.
 
bsupport: Yes, the fields are formated the same. This is the oddest thing. In another DB this works fine. I compared all the properties to my "broken" DB and didn't see any differences. I'll go back though and double check everything. Maybe I missed something.

Thanks for your suggestions. I'll look into the code option, but I am a rookie when it comes to writing code. (not bad at adapting it though)

Thanks,

Brian Brian
 
All you have to do is go to the property for each field and look for After Update Select Event Procedure. The Code is this simple:

Private Sub Field_AfterUpdate()
Me.Total.Requery
End Sub

This is all you need
 
Try copying your form, save it with a new name, if it works delete the original and re-name the new.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top