ListBox SelectionChange

I have this code but no works i select one row and the index return -1
way

If ListBox1.Index=-1 Then Return
If Session.ConnMainServer(ListBox1.Cell(ListBox1.ListIndex,0),ListBox1.Cell(ListBox1.ListIndex,1),ListBox1.Cell(ListBox1.ListIndex,2),ListBox1.Cell(ListBox1.ListIndex,3))=False Then
MsgBox “Error No DataBase Found”
Session.DbConnMain.Close
WebCuadres.CompanyLogin1.Close
Exit Sub
End If
Session.StoreName=ListBox1.Cell(ListBox1.ListIndex,0)
WebCuadres.CompanyLogin1.Close
WebCuadres.Show

Try ListBox1.ListIndex instead of Index.

Thanks
Greg

I got sometimes an error: I use LastIndex instead of ListIndex.

After all, that is an error of one character against… 8 that are correct ! ;-:slight_smile:

Fortunately, finding this error is easy.