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

Summing the values using multiple combo box in access

P: 7
Hi all,

I have a problem with adding the selected values from three different combo box.
I want the sum of these values selected, in a different text box.

Please let me know if you need further details.
Please help me to do this in a simple way...

Thanks in advance,
Prashant
Feb 22 '07 #1
Share this Question
Share on Google+
9 Replies


Rabbit
Expert Mod 10K+
P: 12,315
Well... what's the problem?
Feb 22 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Hi all,

I have a problem with adding the selected values from three different combo box.
I want the sum of these values selected, in a different text box.

Please let me know if you need further details.
Please help me to do this in a simple way...

Thanks in advance,
Prashant
Make control source of the textbox
Expand|Select|Wrap|Line Numbers
  1. =[Combo1Name]+[Combo2Name]+[Combo3Name]
Mary
Feb 23 '07 #3

P: 7
Make control source of the textbox
Expand|Select|Wrap|Line Numbers
  1. =[Combo1Name]+[Combo2Name]+[Combo3Name]
Mary

Thank you, It works....

I have a similar kind of problem...
same three Combo box has 2 columns each (Options and Ratings)
Options (Ratings)
Strongly Agree (50)
Agree (40)
Neutral (30) and so on....

Now I want only, the sum of ratings to be displayed on text box
for ex: if I select Strongly agree(50) from Combo1 and Agree(40) from Combo2 and Neutral(30) from combo3 --- Result in text box should be 120

Is it possible to do this, let me know...
Thanks in advance for your handy suggestions.
Feb 23 '07 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Thank you, It works....

I have a similar kind of problem...
same three Combo box has 2 columns each (Options and Ratings)
Options (Ratings)
Strongly Agree (50)
Agree (40)
Neutral (30) and so on....

Now I want only, the sum of ratings to be displayed on text box
for ex: if I select Strongly agree(50) from Combo1 and Agree(40) from Combo2 and Neutral(30) from combo3 --- Result in text box should be 120

Is it possible to do this, let me know...
Thanks in advance for your handy suggestions.
In the combobox properties change the bound column in each from 1 to 2. This will only work if you are not using the combo boxes for any other reason and not storing the selections in a table anywhere.

Mary
Feb 23 '07 #5

P: 7
In the combobox properties change the bound column in each from 1 to 2. This will only work if you are not using the combo boxes for any other reason and not storing the selections in a table anywhere.

Mary

I did change the bound coumn to 2, but it concatenates the values and does'nt sum the values.

Thanks
Prash
Feb 26 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
I did change the bound coumn to 2, but it concatenates the values and does'nt sum the values.

Thanks
Prash
Prash are these number values or strings. They have to be numbers if you want to add them.

Mary
Feb 26 '07 #7

P: 7
Prash are these number values or strings. They have to be numbers if you want to add them.

Mary
Hi,
As I told before the combo box contains two coumns (Options and Ratings)
whereas Options is Text and Ratings is Number datatype.
When I from select Comb1 i.e. Option as Strongly agree - its rating 50 display in text box and from combo2 i.e. Option as Agree - its rating 40 display in text box. The result shows 5040 instead 90 in text box.

But when I take out the options column from table and keep only ratings which as number as datatype then I get the result as 90.

I want both Options and ratings in same combo and with the result.
Is it possible?
Hope this helps u understand my problem, Sorry for such annoying problem.

Thanks,
Prash
Feb 26 '07 #8

MMcCarthy
Expert Mod 10K+
P: 14,534
Hi,
As I told before the combo box contains two coumns (Options and Ratings)
whereas Options is Text and Ratings is Number datatype.
When I from select Comb1 i.e. Option as Strongly agree - its rating 50 display in text box and from combo2 i.e. Option as Agree - its rating 40 display in text box. The result shows 5040 instead 90 in text box.

But when I take out the options column from table and keep only ratings which as number as datatype then I get the result as 90.

I want both Options and ratings in same combo and with the result.
Is it possible?
Hope this helps u understand my problem, Sorry for such annoying problem.

Thanks,
Prash
Prash

Check that the following properties are set for all combo boxes ...

Column Count = 2
Column Widths = 2cm; 2cm
Bound Column = 2

Mary
Feb 26 '07 #9

NeoPa
Expert Mod 15k+
P: 31,186
Hi,
As I told before the combo box contains two coumns (Options and Ratings)
whereas Options is Text and Ratings is Number datatype.
When I from select Comb1 i.e. Option as Strongly agree - its rating 50 display in text box and from combo2 i.e. Option as Agree - its rating 40 display in text box. The result shows 5040 instead 90 in text box.

But when I take out the options column from table and keep only ratings which as number as datatype then I get the result as 90.

I want both Options and ratings in same combo and with the result.
Is it possible?
Hope this helps u understand my problem, Sorry for such annoying problem.

Thanks,
Prash
Prash,
It's hard to know why this is happening in your case. It's not standard behaviour, but I would think getting the required information from you as to what is wrong may be quite complicated.
As an alternative, try setting the Control Source of your TextBox control instead to :
Expand|Select|Wrap|Line Numbers
  1. =Val([Combo1Name])+Val([Combo2Name])+Val([Combo3Name])
Let us know if this is an acceptable work-around. If not we will have to dig deeper, but that will require you to be very precise and specific about what you have set for various items in your database.
Feb 26 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.