Dim seStr as string = "select * from table_name"
Dim cmd as sqlcommand(seStr, conn)
Dim dr as datareader
dr=cmd.excutereader
while dr.read
combobox1.items.add = dr("field_name")
end while
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
Set RS = New ADODB.Recordset
RS.Open "select * from Table2 where SN = '" & Combo2.Text & "'", cn, adOpenKeyset, adLockOptimistic
If Not RS.EOF Then
Me.Combo1.Text = RS!Device
End If
RS.Close
Set RS = Nothing
End Sub