473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Adding results from multiple combo boxes

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
1 2551
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
6
by: ljungers | last post by:
Hi to all and hope someone may have an answer for me. I have a Form named Cust_lukup_Form that has 3 text boxes and a click button that uses a OnClick to call Cust_lukup_Macro that runs an...
17
by: rookie user | last post by:
Hello everyone, I am very new to Access so I definetely need help. I have a form with two combo boxes (outbound): 1.- City Names and 2.- Postal Codes These combo boxes are based on a Table...
0
by: chixor1 | last post by:
Good afternoon All I have got over some hurdles on my current project and now I am stuck again. Im now having issues with writing the code that takes the calculations from my txt boxes and inserts...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
1
by: dougmeece | last post by:
Good Morning everyone. I have a form with two combo boxes and 1 command button. I am trying to use the command button to search a table and populate a query. I will then have the query display the...
0
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.