Cordial greeting colleagues, it turns out that I have a form in MS Visual basic about activities that should be done, there is a combobox for each activity with values from 1 to 8, depending on what is selected in each combobox should be added to a variable a certain value, which in this case is valued, what I am trying to do is that when the activities have the same value in the combobox the variable takes the value only once, and does not add the 7 times, only that adds when each activity has different values selected in the combobox. Example: If the value 6 is selected in all the comboboxes, then the value is = 2951000 but if in 6 of the combobox the value 6 is selected and in the last combobox they selected the value 7, then the value of the variable would be the sum of the two values, valued = 2951000 + 2214000 (Value when selecting 7 in combobox). Previously, the exercise was done with a single combobox for all the activities and with this same calculation, using this code:
Code:
'Declaramos condicion multiple de seleccion
Select Case comboescalafon.SelectedIndex
Case 0
valoresca = 15493000
Case 1
valoresca = 12542000
Case 2
valoresca = 9591000
Case 3
valoresca = 7378000
Case 4
valoresca = 5902000
Case 5
valoresca = 4427000
Case 6
valoresca = 2951000
Case 7
valoresca = 2214000
Case 8
valoresca = 1476000
End Select
This would be the example, in the majority of activities select the value 6 in the combobox therefore the sca value is 2951000, but in the report activity select the combobox 7 therefore sca value would be 2214000, so what I want to do is that if one is different as in this case, that all are 6 and the last one is 7 then values would have to be 2951000 + 2214000, this calculation is done by pressing the quote button.