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 chkoption_Click()
If Me.chkoption Then
Me.cmbRechoption.Visible = False
Else
Me.cmbRechoption.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkmajeure_Click()
If Me.chkmajeure Then
Me.cmbRechmajeure.Visible = False
Else
Me.cmbRechmajeure.Visible = True
End If
RefreshQuery
End Sub
Private Sub chklangue_Click()
If Me.chklangue Then
Me.cmbRechlangue.Visible = False
Else
Me.cmbRechlangue.Visible = True
End If
RefreshQuery
End Sub
Private Sub chkEPS_Click()
If Me.chkEPS Then
Me.cmbRechEPS.Visible = False
Else
Me.cmbRechEPS.Visible = True
End If
RefreshQuery
End Sub
Private Sub cmbRechoption_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechmajeure_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechlangue_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub cmbRechEPS_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 NO_DOSSIER, OPTION, MAJEURE, LANGUE, EPS FROM OPTIONS"
Me.lstResults.Requery
End Sub
Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT NO_DOSSIER, OPTION, MAJEURE, LANGUE, EPS FROM OPTIONS WHERE NO_DOSSIER <> '' "
If Not Me.chkoption Then
SQL = SQL & " And OPTIONS!OPTION = '" & Me.cmbRechoption & "' "
End If
If Not Me.chkmajeure Then
SQL = SQL & " And OPTIONS!MAJEURE = '" & Me.cmbRechmajeure & "' "
End If
If Not Me.chklangue Then
SQL = SQL & " And OPTIONS!LANGUE = '" & Me.cmbRechlangue & "' "
End If
If Not Me.chkEPS Then
SQL = SQL & " And OPTIONS!EPS like '" & Me.cmbRechEPS & "' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Debug.Print SQL
Me.lblStats.Caption = DCount("*", "OPTIONS", SQLWhere) & " / " & DCount("*", "OPTIONS")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery
End Sub
Private Sub lstResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "Frm saisie des options par PE1", acNormal, , "[NO_DOSSIER] = '" & Me.lstResults & "'" |
Partager