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
| Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT ID_Ressource, Domaine, Entite, Theme, Date_Ressource, Libelle_Ressource FROM Tbl_Ressource WHERE Tbl_Ressource!ID_Ressource <> 0 "
If Not Me.chkDomaine Then
SQL = SQL & "And Tbl_Ressource!Domaine = '" & Me.CmbDomaine & "' "
End If
If Not Me.ChkEntite Then
SQL = SQL & "And Tbl_Ressource!Entite = '" & Me.CmbEntite & "' "
End If
If Not Me.ChkMotsCle Then
SQL = SQL & "And Tbl_Ressource!MotsCle_Ressource like '*" & Me.TxtMotsCle & "*'"
End If
If Not Me.ChkTheme Then
SQL = SQL & "And Tbl_Ressource!Theme = '" & Me.CmbTheme & "' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.lblStats.Caption = DCount("*", "Tbl_Ressource", SQLWhere) & " / " & DCount("*", "Tbl_Ressource")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery
End Sub |
Partager