|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I know I am close, but I am very rusty at this VBA
stuff. I get a result, but it happens for each option I choose from my combo boxes. Basically this is the whole picture. I have this matrix that am following. I have 5 values for each combo box. If you choose a "1" from one dropdown box, and a "1" from the other dropdown box, THEN you get this certain text in a textbox. results is my text box. Here is my pseudo code: Private Sub critnum_AfterUpdate() Dim assm As Byte Dim crit As Byte assm = assnum - - This is one field (one combo box) crit = critnum - - -this is the other field, and after this is chosen, I should get a result. I have to do about 25 IF Then statements, because there are 25 possibilities. If (assm = 2) + (crit = 2) Then results = "Critical" End If End Sub Thanks All, No pressure, but I have to have an answer today. |
|
#2
|
||||
|
||||
|
Would it be possible to add them?
Then do a select case? something like this Code:
Dim assm As Integer
Dim crit As Integer
Dim total As Integer
Dim results As String
assm = CInt(cboAssNum.Text)
crit = CInt(cboCritNum.Text)
total = assm + crit
Select Case total
Case 1
results = "Blah"
Case 2
results = "Blah2"
Case 3
results = "Blah3"
End Select
txtResults.Text = results
|
|
#3
|
|||
|
|||
|
Actually, this is a comparison so if one value is 2 and the other is 2
then the result will be Blah. There will be 5 distinct answers depending on whatever is chosen from either of the dropdown combo boxes. I think we are close, and maybe I need some more education, or at least some more intelligence. ha ha |
|
#4
|
|||
|
|||
|
This
If (assm = 2) + (crit = 2) Then should be If (assm = 2) and (crit = 2) Then for one thing.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Compare 2 combo boxes and get a text result |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|