Dear Sir

I am trying to select range of data for a particular item in VB6. That is, I have two ComboBox. One is storing Item & another Item code.

I want to display 100 to 199 in Combo2 when I shall select Item "Computer" in Combo1 and will display Item code 200 to 299 in Combo2 for "Monitor" when I will select from Combo1. At that time, previous Item code 100 to 199 for Item "Computer" will not be in Combo2. I have used below code but not working. Please help.

CODE:
Private Sub combo1_Click()
Dim a, b As Integer
If combo1.Text = "Computer" Then
For a = 100 To 199 Step 1
combo2.AddItem (a)
Next a
combo2.text=""
ElseIf combo1.Text = "Monitor" Then
For b = 200 To 299 Step 1
combo2.AddItem (b)
Next b
combo2.text=""
End If
End Sub

Regards
Pervez