1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.SelectedIndexChanged
Dim vn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\agrimed.mdb")
vn.Open()
Dim cmdb As New OleDbCommand("select [Code Frs],[Raison Sociale] FROM fournisseur where [Code TVA]=@c1", vn)
With cmdb.Parameters
.Add("@c1", OleDbType.Char).Value = ComboBox4.Text
End With
Dim dra As OleDbDataReader = cmdb.ExecuteReader
Do While dra.Read
ComboBox2.Text = (dra.GetString(0))
ComboBox3.Text = (dra.GetString(1))
Loop
dra.Close()
cmdb.Dispose()
vn.Close()
vn.Dispose()
End Sub |
Partager