J'ai une requête, avec une énorme condition que je reprends d'un code d'un autre stagiaire et que je veux faire la même chose avec, mais là il semble y avoir une erreur, je ne sais pas si vous êtes capables de m'aider..

Voici la condition :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
 
jan = CDate(Format(tempDate, "yyyy") + "/01/31")
fev = LastOfMonth(CDate(Format(tempDate, "yyyy") + "/02/28"))
mar = CDate(Format(tempDate, "yyyy") + "/03/31")
avr = CDate(Format(tempDate, "yyyy") + "/04/30")
mai = CDate(Format(tempDate, "yyyy") + "/05/31")
juin = CDate(Format(tempDate, "yyyy") + "/06/30")
juil = CDate(Format(tempDate, "yyyy") + "/07/31")
aout = CDate(Format(tempDate, "yyyy") + "/08/31")
sep = CDate(Format(tempDate, "yyyy") + "/09/30")
Oct = CDate(Format(tempDate, "yyyy") + "/10/31")
nov = CDate(Format(tempDate, "yyyy") + "/11/30")
dec = CDate(Format(tempDate, "yyyy") + "/12/31")
 
Set rstSuiviReport = dbs.OpenRecordset("select DateReport, Date, FermetureDate from rqtTempsSuivi", dbOpenDynaset)
Set rstTblGraphTotal = dbs.OpenRecordset("tblGraph", dbOpenDynaset)
 
Do While Not rstSuiviReport.EOF
    If ((Not IsNull(rstSuiviReport.Fields("DateReport"))) And (rstSuiviReport.Fields("Date") < jan) And (rstSuiviReport.Fields("FermetureDate") > jan Or IsNull(rstSuiviReport.Fields("FermetureDate")))) Or ((IsNull(rstSuiviReport.Fields("DateReport"))) And (DateDiff("d", rstSuiviReport.Fields("Date"), jan) > 31) And (rstSuiviReport.Fields("FermetureDate") > jan Or IsNull(rstSuiviReport.Fields("DateFermeture")))) Then
        rstTblGraphTotal.FindFirst "mois = 'janv' and annee = '" & Format(tempDate, "yyyy") & "'"
        If Not rstTblGraphTotal.NoMatch Then
            With rstTblGraphTotal
            .Edit
            !suivireport = !suivireport + 1
            .Update
            End With
        End If
    End If
    rstSuiviReport.MoveNext
Loop
rstSuiviReport.Close
rstTblGraphTotal.Close
Sur ma condition, c'est là que survient mon problème : Élément non trouvé dans cette collection.