|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
ok i am confused. when i run this code (below) there is 4 items in the combo box. it shows all of them in the combo box, however the link to display the text in the text box only works on number 4? 1,2,3 will not place the text in the text box. i have a feeling its the way i am using the if, then, else statements but i have no clue
!!i have tried several different ways, but nothing seems to be doing it for me......... Private Sub Combo1_Click() Dim Compound_choiceO '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''' If Combo1.Text = "21950" Then Compound_choiceO = MsgBox("User Choose Compound 21950", 1, "Is This Correct?") End If 'if cancel is picked populate combo1 with nothing ("") If Compound_choiceO = 2 Then Combo1.Text = "" End If 'THIS SECTION RIGHT HERE IS NOT WORKING If Compound_choiceO = 1 Then txtbox1.Text = "21950-03 RL-60 Tipure MB, 3 Ingredients at 366 Pounds Total" If Compound_choiceO = 2 Then txtbox1.Text = "" End If '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''' If Combo1.Text = "25608" Then Compound_choiceO = MsgBox("User Choose Compound 25608", 1, "Is This Correct?") End If 'if cancel is picked populate combo1 with nothing ("") If Compound_choiceO = 2 Then Combo1.Text = "" 'THIS SECTION RIGHT HERE IS NOT WORKING If Combo1.Text = "25608" Then txtbox1.Text = "25608-03 Dark Gray EPDM, 7 Ingredients at 308.2 Pounds Total" Else: txtbox1.Text = "" End If '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''' If Combo1.Text = "25608-Strip" Then Compound_choiceO = MsgBox("User Choose Compound 25608-Strip", 1, "Is This Correct?") End If 'if cancel is picked populate combo1 with nothing ("") If Compound_choiceO = 2 Then Combo1.Text = "" 'THIS SECTION RIGHT HERE IS NOT WORKING If Compound_choiceO = 1 Then txtbox1.Text = "25608-03 'Strip' Dark Gray EPDM, 7 Ingredients at 299 Pounds Total" Else: txtbox1.Text = "" End If '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''' If Combo1.Text = "25840" Then Compound_choiceO = MsgBox("User Choose Compound 25840", 1, "Is This Correct?") End If 'if cancel is picked populate combo1 with nothing ("") If Compound_choiceO = 2 Then Combo1.Text = "" If Combo1.Text = "25840" Then 'This one actually works!! Why?? txtbox1.Text = "25840-03 Light Gray EPDM/Silicone Blend, 7 Ingredients at 301.2 Pounds Total" Else: txtbox1.Text = "" End If End Sub ****The only thing i see different is the End Sub **** |
|
#2
|
||||
|
||||
|
I would try it like this
Code:
Private Sub Combo1_Click()
Dim result
Dim strComboText As String
Dim strText As String
Dim strMessage As String
strComboText = Trim(Combo1.Text)
Select Case strComboText
Case "21950"
strMessage = "21950-03 RL-60 Tipure MB, 3 Ingredients at 366 Pounds Total"
Case "25608"
strMessage = "25680-03 Dark Gray EPDM, 7 Ingredients at 308.2 Pounds Total"
Case "25608-Strip"
strMessage = "25608-03 'Strip' Dark Gray EPDM, 7 Ingredients at 299 Pounds Total"
Case "25840"
strMessage = "25840-03 Light Gray EPDM/Silicone Blend, 7 Ingredients at 301.2 Pounds Total"
End Select
result = MsgBox("User Choose Compound " & strComboText, 1, "Is this correct")
If result = 1 Then
txtBox1.Text = strMessage
Else
txtBox1.Text = ""
End If
End Sub
|
|
#3
|
|||
|
|||
|
Thank you!!!!!!!!!!
Memnoch, God bless you!! you rock!! thank you so much for helping a rookie like me. You should almost get a cut of my pay check.......
![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > if,then,else help (i think!?) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|