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
| Private Sub RefreshQuery()
SQL = "SELECT [N° auto], [Titre Article], Date, [Nom Revue], AI, [Famille AI], Crop, [Famille Crop], Pest, [Famille Pest] FROM requete_rechmulti Where requete_rechmulti.[N° Auto] <>0 "
If Not Me.chkCrop Then
SQL = SQL & "And requete_rechmulti!Crop = '" & Me.cmbRechCrop & "' "
End If
If Not Me.chkAI Then
SQL = SQL & "And requete_rechmulti!AI = '" & Me.cmbRechAI & "' "
End If
If Not Me.chkPest Then
SQL = SQL & "And requete_rechmulti!Pest = '" & Me.cmbRechPest & "' "
End If
If Not Me.chkFamAI Then
SQL = SQL & "And requete_rechmulti![Famille AI] = '" & Me.CmbRechfamAI & "' "
End If
If Not Me.chkFamCrop Then
SQL = SQL & "And requete_rechmulti![Famille Crop] = '" & Me.cmbRechFamCrop & "' "
End If
If Not Me.chkFamPest Then
SQL = SQL & "And requete_rechmulti![Famille Pest] = '" & Me.cmbRechFamPest & "' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.lblStats.Caption = DCount("*", "requete_rechmulti", SQLWhere) & " / " & DCount("*", "requete_rechmulti")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery |
Partager