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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| Option Compare Database
Private Sub RefreshQuery()
Dim SQLRecherche As String
Dim SQLWhere As String
SQLRecherche = "Select N°, Code_Barre, Type, Fabricant, Numéro_de_Produit, Longueur, Notes, Quotas, Total_en_inventaire From Inventaire Where Inventaire!N° <> 0 "
If Not Me.CmbFabricant Then
SQLRecherche = SQLRecherche & "And Inventaire!Fabricant = '*" & Me.CmbFabricant & "' "
End If
If Not Me.CmbNumeroProduit Then
SQLRecherche = SQLRecherche & "And Inventaire!Numéro_de_Produit = '*" & Me.CmbNumeroProduit & "' "
End If
If Not Me.CmbType Then
SQLRecherche = SQLRecherche & "And Inventaire!Type = '*" & Me.CmbType & "' "
End If
If Not Me.TxtCodeBarre Then
SQLRecherche = SQLRecherche & "And Inventaire!Code_Barre like '*" & Me.TxtCodeBarre & "*' "
End If
If Not Me.TxtInventaire Then
SQLRecherche = SQLRecherche & "And Inventaire!Total_en_inventaire like '*" & Me.TxtInventaire & "*' "
End If
If Not Me.TxtLongueur Then
SQLRecherche = SQLRecherche & "And Inventaire!Longueur like '*" & Me.TxtLongueur & "*' "
End If
If Not Me.TxtNotes Then
SQLRecherche = SQLRecherche & "And Inventaire!Notes like '*" & Me.TxtNotes & "*' "
End If
If Not Me.TxtQuotas Then
SQLRecherche = SQLRecherche & "And Inventaire!Quotas like '*" & Me.TxtQuotas & "*' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.LblNombreEntre.Caption = DCount("*", "Inventaire", SQLWhere) & " / " & DCount("*", "Inventaire")
Me.LSTresult.RowSource = SQL
Me.LSTresult.Requery
End Sub
Private Sub CmbFabricant_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub CmbNumeroProduit_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub CmbType_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub TxtCodeBarre_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub TxtInventaire_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub TxtLongueur_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub TxtNotes_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub TxtQuotas_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub |
Partager