I'm new to access and need some advice.
I have a form with scores for a test,at the bottom of the form i need the total of all the different questions added up. I've done the unbound text box that pulls from the individual score boxes and the "=[q1]+[q2]" etcin the control source field, and it works, however i need to include the result on the table with all individual question scores. How can i do this.
I'm sure your rolling your eyes, and its probably right in front of my face but......
Any help would be much appretiated
My situation is i have a form patients fill out ( dementia in the elderly, it measures how far along they are) for every answer they get a score. The forms are hard copy and then data entered. i have it set up where the scores for the questions are put into a number field(named q1, q1, q3 etc. ), at the bottom of the form i have an unbound text box with =[q1]+[q2]+[q3] coded in. A "Total" box, it adds the questions fine but its not recorded in the coresponding table, how do i get the results into a column in the table. I'm sorry for the newbie question but there isn't a begginer forum.
If you could help it would be great.
(Where # is the number value you type in)
Take out the controlsource line that will say something like: =q1+q2...
and make it point to the total field in the table (by using the drop down list)
If you get the properties box up for the last question and go to the events tab and click in the 'after update' line. A box appears on the end with three dots in it. Click on that and select code builder.
Type in the line between the lines that automatically appear:
total = q1+q2+q3
Hold down the Alt key and hit Q: This returns you to the form.
Try it out and see if it works.
I'll explain what you have done:
the question scores and total appear on the same record in the table.
Therefore after all the question results are in you then update the total using the above code.
You have told access that after the last question is updated you want access to calculate the total and place it in the field on the form called total which is bound to the underlying table.
thanks gavinfm, but still no joy
i get where your coming from, it seems lke it should work but i'm getting "0"
iv'e been looking at an old db someone else was using, they had an invisible unbound box with the =[q1]+[q2]+[q3] assigned to it. but it doesn't show up in the table and i don't know how he/she got the result from the unbound text box to the "total" box?????
Thanks again mate
Don't want to be a pain but still getting a 0 in the totals column and on the page, iv'e uploaded the table and form if you can look at it and try to see what i'm doing wrong.
i don't want someone to "just fix it" i need to learn this
Thanks for the patience.
Access accepts almost any word as a field name. However it can be confusing as to what is a reserved word and what is not. So I never use words like: Total, sum, average, database etc...
In preference I would use ScoreTotal, TotSum, ScoreAverage, CurrDatabase...
Because your table already had the field as Total I didn't change that... Instead I changed the text field on the form to xTotal, that way the form was able to point directly to that field and I knew I wasn't going to have any other frustrating issues that using 'Total' may have caused.
At the end of the day it probably didn't matter... I just eliminated the possibility.