Click to See Complete Forum and Search --> : Type Mismatch


Detard
January 31st, 2000, 11:39 AM
Can someone tell me why I'm getting a type mismatch at this line? Thanx for help,
Detard

private Sub qualitylook()
Dim n as Integer
Dim Qual as string

for n = 0 to lstFoundBrit.ListCount
Qual = lstFoundBrit.List(n)
lstFoundBrit.ListIndex = 0
If Left(Qual, 2) <> 1 then
This line ----> lstFoundBrit.RemoveItem (lstFoundBrit.List(lstFoundBrit.ListIndex))
End If
next n
End Sub

Detard
January 31st, 2000, 11:39 AM
Can someone tell me why I'm getting a type mismatch at this line? Thanx for help,
Detard

private Sub qualitylook()
Dim n as Integer
Dim Qual as string

for n = 0 to lstFoundBrit.ListCount
Qual = lstFoundBrit.List(n)
lstFoundBrit.ListIndex = 0
If Left(Qual, 2) <> 1 then
This line ----> lstFoundBrit.RemoveItem (lstFoundBrit.List(lstFoundBrit.ListIndex))
End If
next n
End Sub

Reznor_X
January 31st, 2000, 02:44 PM
>>lstFoundBrit.RemoveItem (lstFoundBrit.List(lstFoundBrit.ListIndex))

remove item expects a numeric value, not an string, so, the correct line should be :

lstFoundBrit.RemoveItem (lstFoundBrit.ListIndex)