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
| Private Sub S_livre_afterupdate(): Call Filtrer: End Sub
Private Sub S_annee_AfterUpdate(): Call Filtrer: End Sub
Private Sub S_cpt1_afterupdate(): Call Filtrer: End Sub
Private Sub S_cpt2_afterupdate(): Call Filtrer: End Sub
Private Sub S_trans_afterupdate(): Call Filtrer: End Sub
Private Sub s_lib_AfterUpdate(): Call Filtrer: End Sub
Private Sub s_piece_AfterUpdate(): Call Filtrer: End Sub
'procédure appelée par chaque saisie d'une donnée dans le filtre
Private Sub Filtrer
Dim f As String
100 f = ""
101 If S_lib > " " Then f = f & IIf(Len(f) > 0, " and ", "") & "libelle like '*" & S_lib & "*'"
102 If S_piece > " " Then f = f & IIf(Len(f) > 0, " and ", "") & "piece like '" & S_piece & "*'"
103 If S_livre > " " Then f = f & IIf(Len(f) > 0, " and ", "") & "livre='" & S_livre & "'"
104 If S_cpt1 > " " Then f = f & IIf(Len(f) > 0, " and ", "") & "compte>='" & S_cpt1 & "'"
106 If S_cpt2 > " " Then f = f & IIf(Len(f) > 0, " and ", "") & "compte<='" & S_cpt2 & "'"
108 If S_trans >= 0 Then f = f & IIf(Len(f) > 0, " and ", "") & "cd_trans=" & S_trans
110 If S_annee > "2000" Then f = f & IIf(Len(f) > 0, " and ", "") & "(year(date_ec)=" & S_annee & ")"
112 If Len(f) > 0 Then
114 Me.recordsource = "select * from RESERVATION where " & f
Else
118 Me.recordsource = "select * from RESERVATION"
End If
End Sub |
Partager