Private Sub ListView1_Click() If ListView1.ListItems.Count > 0 Then Text1.Text = ListView1.ListItems(ListView1.SelectedItem.Index).Text Text2.Text = ListView1.ListItems(ListView1.SelectedItem.Index).ListSubItems(1).Text Sql = "SELECT A.AID,A.UNIT,B.LOC_NAME,C.SNAME FROM ASSET A,LOCATION B,SUPPLIER C WHERE " Sql = Sql + "A.LOC_ID=B.LOC_ID AND A.SUP_ID=C.SUP_ID AND AID=" & Text1.Text RS.Open Sql, CON, 1, 2 Combo2.Text = RS!UNIT COM1 Combo1.Text = RS!LOC_NAME //combo with style - 2 COM5 Combo5.Text = RS!SNAME //combo with style - 2 End If End Sub Private Sub COM5() If Combo5.ListIndex = -1 Then For I = 0 To Combo5.ListCount - 1 Combo5.ListIndex = I Next End If End Sub Private Sub COM1() If Combo1.ListIndex = -1 Then For I = 0 To Combo1.ListCount - 1 Combo1.ListIndex = I Next End If End Sub
ComboBox.Style
2 - DropDownList
Text
ItemIndex
ItemData(index)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)