Sum 2 fields and store the value in a third field (1 Viewer)

raghavchadha

New member
Local time
Today, 10:21
Joined
Jul 16, 2009
Messages
3
Lets say I have 2 fields in a table, Score1 and Score2. I would like to calculate the sum of the scores and save it in the 3rd field called TOTAL.

I'm using MS Access 2007 and was wondering how to do this without SQL or VBA.

I was able to create a query that does this successfully, but i'm not able to display that total from the query on my form. I would also like this value to be displayed as a field in another table.

Thanks, your help will be much appreciated.
 

Rabbie

Super Moderator
Local time
Today, 18:21
Joined
Jul 10, 2007
Messages
5,906
Welome to the forum

You should never store calculated values in a table. Perhaps you should base your form on a query which includes the calculated value
 

raghavchadha

New member
Local time
Today, 10:21
Joined
Jul 16, 2009
Messages
3
Thanks for the prompt response Rabbie.

I did try that as well, I created a query in which there are 2 columns, Field1 and Field2 which import the values from the table/form. In the third field, i entered: Total=[Field1]+[Field2].

On running this query, the Total is displayed correctly, but I'm not sure how to access this stored value. Am i correct in saying that a query only displays information, not store it?

My end goal is to display this TOTAL as a field in another table all together.
 

MSAccessRookie

AWF VIP
Local time
Today, 13:21
Joined
May 2, 2008
Messages
3,428
Thanks for the prompt response Rabbie.

I did try that as well, I created a query in which there are 2 columns, Field1 and Field2 which import the values from the table/form. In the third field, i entered: Total=[Field1]+[Field2].

On running this query, the Total is displayed correctly, but I'm not sure how to access this stored value. Am i correct in saying that a query only displays information, not store it?

My end goal is to display this TOTAL as a field in another table all together.

It is not normal practice to store calculated data, since the Field contents are potentially subject to change each and every time the form is opened and the Field data is recalculated.
 

akt01

Registered User.
Local time
Today, 18:21
Joined
Jun 19, 2003
Messages
21
If I understand your question ...

If your form is based on a query which contains Score1, Score2 and TOTAL, then create a textbox on the form, and use TOTAL as your Control Source. It should appear as an option in the drop down box.

If you want this data to appear in Form B, then create a text box, click the three dots ... next to Control Source, then click Forms, and Loaded Forms, and navigate to Form A, TOTAL. You can have as your Control Source any data on any other open form.

good luck
 

raghavchadha

New member
Local time
Today, 10:21
Joined
Jul 16, 2009
Messages
3
I see, thanks for the inputs. I'm going to try this with the approach you'll suggested.
 

boblarson

Smeghead
Local time
Today, 10:21
Joined
Jan 12, 2001
Messages
32,059
And just as an FYI for you -

You basically can use a query anywhere you can use a table (which a lot of people do not know so they spend time trying to make a table for a report, or an export, etc. when they do not have to do so).
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 18:21
Joined
Jun 16, 2000
Messages
1,954
And just as an FYI for you -

You basically can use a query anywhere you can use a table (which a lot of people do not know so they spend time trying to make a table for a report, or an export, etc. when they do not have to do so).
I agree - it's not immediately obvious you can do this - when you use the wizards, they typically present you with a choice of tables and it's easy to overlook the option to choose from the queries too.
 

Users who are viewing this thread

Top Bottom