It won't - you need to put the code in the After_Update
event of the Score6 field...
this way what happens is;
The hidden box calculates on the fly the total score when you enter a number in to the Score1 thru Score6 fields as this happens the Score6 After_Update event fires, reads the value in the Calctotscore field and sends it to the TotalScore Field
In my example just change the Calctotscore Fieldname to TotalHidden and TotalScore fieldname to Total to achieve the same effect.
When you write: ....but I need that number to appear in the form AND the table under "Score Total" you are unintentionally looking to create problems you don't want...
Basic rule in databases is to only enter a datum once.
Sooo, if say:
score1 = 1
score2 = 1
score3 = 1
Total score does not need to be recorded, you already know it - 3. It is the sum of the individual scores. I.E. the total is implicit in the data you have already entered and you should not re-enter it.
Instead, when you want to view or report the total, whether on your data entry form, or on a report, use an unbound textbox with a recordsource like =[score1]+[score2]+[score3]+ etc etc
Perhaps better yet go to something like =nz([score1],0)+ nz([score2],0)+ nz([score3],0)+ nz([score4],0) .....
The nz will get rid of any "nulls" that might goof up your sums - it makes your totalling expression just see the nulls as zeros.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.