Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

combo1 help using large if statement's

$
0
0
i had issue before using large if statments for combo1 , when wring large if and else over 50+ it gives error i need a way to write this please help

example project
combo1 contains

Code:

india:1
usa:1
canada:2


combo1 will contain at least 4k items


Code:

Private Sub Combo1_Click()
If Combo1.Text = "india:1" Then
Text1.Text = "222"
Text2.Text = "192.xxx.xxxx"
Else
If Combo1.Text = "iaa:2" Then
Text1.Text = "112"
Text2.Text = "192.xxx.xxxx"
Else
If Combo1.Text = "udda:1" Then
Text1.Text = "4444"
Text2.Text = "192.xxx.xxxx"
Else
If Combo1.Text = "caaada:2" Then
Text1.Text = "854"
Text2.Text = "192.xxx.xxxx"
End If
End If
End If
End If
End Sub


:(is there a way to add these if and else so it dont give error because when i write small amount its ok but writing over 50-60 or more 100 or more gives some error so i need new approach :(

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>