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

Display the sum of several fields into one field 2

Status
Not open for further replies.

lamaar

Technical User
Jun 29, 2000
392
GB
I am relatively new to Access.&nbsp;&nbsp;I Have several fields, eg. Spelling, Accuracy etc which are assigned a number via a form.&nbsp;&nbsp;I want these numbers when entered to be allocated to another filed, namely, Score.&nbsp;&nbsp;I can get the form to display a running total by using =[Spelling] + [Accuracy] etc but this does not allocate the sum to the field Score.&nbsp;&nbsp;How can I do this?&nbsp;&nbsp;I then want to display the score as a percentage!<br><br>Please help!<br><br>Lamaar
 
A few questions:<br><br>Is the form bound to a table or query?&nbsp;&nbsp;Does that table or query have the field Score in it?&nbsp;&nbsp;If you do, you can write code in the AfterUpdate events of the fields that make up your score to edit the field Score.<br><br>Is that what you are looking for?&nbsp;&nbsp;Let me know if you need more detail, or if I totally misunderstood your question.<br><br>Kathryn
 
Kathryn,<br><br>As I am new to Access, I have not probably explained myself correctly.&nbsp;&nbsp;I have a table with several fields, some being Spelling, Accuracy etc.&nbsp;&nbsp;These are number fields.&nbsp;&nbsp;On the Form, I enter a score for each field.&nbsp;&nbsp;I then want to display the total score for all the fields into another field, namely, Score.&nbsp;&nbsp;I will then use this field (Score) in my Query's and Reports.&nbsp;&nbsp;My problem is that although I can diaplay the total on screen, (using =Sum[Spelling]+[Accuracy] etc) I cannot allocate the total to another field, Score.&nbsp;&nbsp;Eg, I want Score=Spelling+Accuracy etc.&nbsp;&nbsp;I am not bothered if I cannot display it on screen, just as long as I can use it in my Query's and Reports.<br><br>Thanks for replying<br><br>Lamaar
 
I was afraid of that.&nbsp;&nbsp;What you want to do is a BIG no-no in the database design world.&nbsp;&nbsp;You should never store a calculated value.<br><br>What you need to do is create a query containing all the fields and a new field called Score.&nbsp;&nbsp;The only place the value score will live will be in this query.&nbsp;&nbsp;The beauty of this is that if you change one of the component numbers, you don't need to fix Score, it will be re-calculated anytime you run a report based on the query.<br><br>In the query, after you have added all the fields, go to a blank column and type<br>&nbsp;&nbsp;&nbsp;&nbsp;Score:[FirstFieldName]+[SecondFieldName}+.....<br><br>Now run the query. Your score will show in the query results.&nbsp;&nbsp;If you don't want to show all the component numbers, go back into the query design and uncheck the checkbox on the query design grid on the Show line.<br><br>Now base any other forms and reports on this query.<br><br>I think you can actually base the form in which you do your data entry on this query and do a requery action after you change any numbers.<br><br>Hope that helps.&nbsp;&nbsp;Let me know if you need more info or if I have totally confused you.<br>Kathryn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top