1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Private Sub txtNumProd_Change()
Dim sReq As String
sReq = "SELECT Produits.nom, Produits.Description, Fournisseurs.nom "
sReq = sReq & "FROM Fournisseurs INNER JOIN Produits ON Fournisseurs.IDFournisseur=Produits.IDFournisseurs "
If (txtNumProd <> "") Then
sReq = sReq & " Where Produits.nom like '" & txtNumProd.Text & "' "
Else
sReq = sReq & " Where true=true "
End If
If (txtNomProd <> "") Then
sReq = sReq & " AND Produits.Description like '%" & txtNomProd.Text & "%' "
Else
sReq = sReq & " AND true=true "
End If
If (txtNomProducteur <> "") Then
sReq = sReq & " AND Fournisseurs.nom like '" & txtNomProd.Text & "' "
Else
sReq = sReq & " AND true=true "
End If
sReq = sReq & "ORDER BY Produits.MaterialNumberLong;"
sReq = sReq & " "
lstResult.RowSource = sReq
lstResult.Requery
If (lstResult.ListCount) > 0 Then
lstResult.Selected(0) = False
End If
End Sub |
Partager