useing sum in form???

Crash1hd

Registered CyberGeek
Local time
Today, 13:14
Joined
Jan 11, 2004
Messages
143
I am having trouble with the code below I have a box in my form that is the total_score of all my questions and I want it to autoupdate and then input that total into the table under its heading total score, but I am having trouble I found that if I use

say question one score is 1 and question 2 score is 1 then when I use

=([Question_1]+0+[Question_1]) i get 2

but when I use

=([Question_1]+[Question_1]) i get 11

and when I use

=sum([Question_1]+[Question_1]) I get 22

and when I use

=sum([Question_1]+0+[Question_1]) I get 4

what gives can anyone explain where I am going wrong also where should I be putting this to get the totals I am putting the code in the control_source yet by doing that I dont know how to update it to the table?
 
=Val([Question_1]) + Val([Question_1])

You need the Val() around each textbox.
 
So like this

=Val([question_1])+Val([question_2])+Val([Question_3])+Val([Question_4])+Val([Question_5])+Val([Question_6])+Val([Question_7])+Val([Question_8])+Val([Question_9])+Val([Question_10])+Val([Question_11])

is there any better way?
 
Pat that makes total sense so instead of it being a text field it should be a number field in the table :) thankyou


But why would -- work where + wouldnt or would that just be a microsoft glitch lol :)

or is it because by adding the - to the beginning of the text tells it to be a number?
 
That is what I thought!



Thankyou Thankyou Thankyou

You make sense of all my chaos!

:D :cool: :D :cool: :D :cool: :D :cool:
 

Users who are viewing this thread

Back
Top Bottom