1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Dim per As Date
Dim inter As String
Dim sql As String
Dim rst As DAO.Recordset
per = Format(ZtDateINT, "mm/d/yyyy")
inter = Me!LmIntervenantINT
sql = "SELECT T_Interventions.Date_INT, T_Interventions.Intervenant_INT, Sum(T_Interventions.Duree_INT) AS SommeDeDuree_INT "
sql = sql & "from T_Interventions "
sql = sql & "GROUP BY T_Interventions.Date_INT, T_Interventions.Intervenant_INT "
sql = sql & "HAVING (((T_Interventions.Date_INT)=#" & per & "#) AND ((T_Interventions.Intervenant_INT)='" & inter & "')); "
Set rst = CurrentDb.OpenRecordset(sql)
If rst.RecordCount = 0 Then
Exit Sub
Else
If rst.Fields(2).Value + LmDureeINT > 1 Then
MsgBox "La durée totale des interventions dépense la journée !"
End If
End If |
Partager