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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a calculated field total in a table

Status
Not open for further replies.

juliesmomma

Technical User
Jun 3, 2002
36
0
0
US
I have a form based on a query. In that query, I have a calculated field. How do I get that field to be saved in the table?

Thanks!
 
Can you do the calculation on the form, rather than the query?
 
AccessAce,
I tried that but it still doesn't allow me to save the calculation total in the table.
In the query I have set up a calculated field that looks similar to this where the field in the table and query is Points.

Points:Q1Points+Q2Points+Q3Points+...

Can you tell me how to create a calculated field on a form that will save to the table?

Thank you much!
 
Perhaps you could have a control on the form that displays the calculation and a button nearby that will copy that amount to another control bound to the field in the table. Both the calculation control and the table bound control will have to be on the form.

Here's a thought though. If the query is simply adding up all the scores, why not just run an update query at the click of a button on the form where the scores are input?

I think I may know what you are trying to do, but there are a lot of different ways to get done what you want. I'll help as I can, just let me know if I'm getting off track.
 
I tried your suggestion but I couldn't make it work. I've tried writing VB code but haven't been successful. I would really rather it do it automatically instead of the user having to push a button to make it do it.

Do you have any other suggestions?
 
I was always taught not to store calculated results unless it would save huge amounts of time for the user. If you have the necessary data, why not just leave a calculated field in the form/report? Like AccessAce alluded to, find an appropriate event (like a change or update event) and refresh the data.

Just my 2¢.
 
Thanks for you input! I don't normally store calculated results but I am designing a Cardiovascular Risk Factor Analysis form and it computes the total points for each category to come up with a number to designate it as Low, Medium or High Risk. This is the only reason I want to store this number. I tried VB code in the change and afterupdate events but I couldn't get anything to work correctly.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top