Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old September 17th, 2004, 12:56 PM
hack_programr hack_programr is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: akron, ohio
Posts: 33 hack_programr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 1 m 36 sec
Reputation Power: 0
Question if,then,else help (i think!?)

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 ****

Reply With Quote
  #2  
Old September 17th, 2004, 01:59 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,751 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 3 h 32 m 46 sec
Reputation Power: 443
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
Comments on this post
hack_programr disagrees: the man!

Reply With Quote
  #3  
Old September 17th, 2004, 02:11 PM
hack_programr hack_programr is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: akron, ohio
Posts: 33 hack_programr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 1 m 36 sec
Reputation Power: 0
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.......

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > if,then,else help (i think!?)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway