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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
| Option Compare Database
Private Sub chkRechDescr_Click()
If Me.chkRechDescr Then
Me.txtRechDescr.Visible = False
Else
Me.txtRechDescr.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkRechRef_Click()
If Me.chkRechRef Then
Me.txtRechRef.Visible = False
Else
Me.txtRechRef.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkPhase_Click()
If Me.chkPhase Then
Me.cmbRechPhase.Visible = False
Else
Me.cmbRechPhase.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkLignepdt_Click()
If Me.chkLignepdt Then
Me.cmbRechLignepdt.Visible = False
Else
Me.cmbRechLignepdt.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkOuvrele_Click()
If Me.ChkOuvrele Then
Me.cmbRechOuvrele.Visible = False
Else
Me.cmbRechOuvrele.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkPays_Click()
If Me.chkPays Then
Me.cmbRechPays.Visible = False
Else
Me.cmbRechPays.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkTitre_Click()
If Me.chkTitre Then
Me.txtRechTitre.Visible = False
Else
Me.txtRechTitre.Visible = True
End If
RefreshQuery
End Sub
Private Sub cmbRechLignepdt_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechOuvrele_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechPays_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechPhase_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub lstResults_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub txtRechDescr_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub txtRechRef_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub txtRechTitre_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case Left(ctl.Name, 3)
Case "chk"
ctl.Value = -1
Case "lbl"
ctl.Caption = "- * - * -"
Case "txt"
ctl.Visible = False
ctl.Value = ""
Case "cmb"
ctl.Visible = False
End Select
Next ctl
Me.lstResults.RowSource = "SELECT Reference, Pays, Phaseprojet, Ouvrageele, Ligneproduit, Description, Lien, Date FROM TableReftech;"
Me.lstResults.Requery
End Sub
Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT Reference, Titre, Pays, Phaseprojet, Ouvrageele, Ligneproduit, Description, Lien, Date FROM TableReftech Where TableReftech!Reference <> 0 "
If Not Me.chkPays Then
SQL = SQL & "And TableReftech!Pays like '" & Me.cmbRechPays & "' "
End If
If Not Me.chkPhase Then
SQL = SQL & "And TableReftech!Phaseprojet = '" & Me.cmbRechPhase & "' "
End If
If Not Me.ChkOuvrele Then
SQL = SQL & "And TableReftech!Ouvrageele like '" & Me.cmbRechOuvrele & "' "
End If
If Not Me.chkLignepdt Then
SQL = SQL & "And TableReftech!Ligneproduit like '" & Me.cmbRechLignepdt & "' "
End If
If Not Me.chkRechRef Then
SQL = SQL & "And TableReftech!Reference = '*" & Me.txtRechRef & "*' "
End If
If Not Me.chkTitre Then
SQL = SQL & "And TableReftech!Titre = '*" & Me.txtRechTitre & "*' "
End If
If Not Me.chkRechDescr Then
SQL = SQL & "And TableReftech!Description = '*" & Me.txtRechDescr & "*' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.lblStats.Caption = " / " & DCount("*", "TableReftech")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery
End Sub
Private Sub lstResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "ModifierSupprimer", acNormal, , "[Reference] = " & Me.lstResults
End Sub |
Partager