By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

Adding results from multiple combo boxes

P: n/a
It has been a while since I have done anything on MS Access and I seem
to be a bit rusty. I hope someone could help me solve my issue. I have
a form that has multiple combo boxes on it. Each box has 4 possible
answers to a question. Each of the 4 possible answers is also assigned
a value: answer 1 is worth 1 point, answer 2 is worth 2 points....
What I need to do now is add togethor the points of all the combo
boxes. So far I have given each combo box 2 columns. The first column
has the answer and the second has the point value for each given
answer. I put an unbound textbox next to each combo box. After updating
each combo box, the text box next to it populates with the point value
of the answer given. Finally I put a text box at the top of the form
that is supposed to add all of the text boxes. Unfortunately it isn't
working correctly. Example:
Question 1
(Combo box): Answer 2 (Text Box): 2
Question 2
(Combo box): Answer 1 (Text Box): 1

(total text box): 21
The total box just lists all the points next to each other instead of
adding them togethor. If all 10 questions were answered with the first
answer the total should be 10 but it gives me 1111111111.
Any idea why this is happening

Nov 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In your code where you add your text boxes together to get your total,
instead of just putting th etext box name, use cint(textboxName).

For example I had txtQ1,txtQ2, and txtAns. My line of code was:
txtAns = cint(txtQ1) + cint(txtQ2)

Voila!

Shawn Yates wrote:
It has been a while since I have done anything on MS Access and I seem
to be a bit rusty. I hope someone could help me solve my issue. I have
a form that has multiple combo boxes on it. Each box has 4 possible
answers to a question. Each of the 4 possible answers is also assigned
a value: answer 1 is worth 1 point, answer 2 is worth 2 points....
What I need to do now is add togethor the points of all the combo
boxes. So far I have given each combo box 2 columns. The first column
has the answer and the second has the point value for each given
answer. I put an unbound textbox next to each combo box. After updating
each combo box, the text box next to it populates with the point value
of the answer given. Finally I put a text box at the top of the form
that is supposed to add all of the text boxes. Unfortunately it isn't
working correctly. Example:
Question 1
(Combo box): Answer 2 (Text Box): 2
Question 2
(Combo box): Answer 1 (Text Box): 1

(total text box): 21
The total box just lists all the points next to each other instead of
adding them togethor. If all 10 questions were answered with the first
answer the total should be 10 but it gives me 1111111111.
Any idea why this is happening
Nov 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.