1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub Ligne_Interv()
Dim Ma_fin, Texte82, Texte84 As Date
If Me.Texte82 > Me.Texte84 Then Me.Texte84 = Me.Texte82
Ma_fin = Me.Texte82
Mon_Param = Texte84
While Ma_fin <= Me.Texte84
If DCount("[Ma_Date] + [Genesis] + [N°]", "Interv_date", "[Ma_Date] =#" & Ma_fin & "# And [Genesis] = '" & Texte136 & "' And [N°] = " & Me.Interv_Ident_N°) = 0 Then
If Me.Note <> "" Then
MsgBox ("Date du " & Ma_fin & ": " & DCount("[Ma_Date]", "Interv_date", "[Ma_Date] = # " & Format(Ma_fin, "mm/dd/yy") & " #") & "-" & Len(Ma_fin) & "-" & Format(Ma_fin, "dd/mm/yy"))
DoCmd.RunSQL "INSERT INTO Interv_date ( N°,Origine,Ma_Date,Ma_date_Fin,Genesis,Type_Inter,Note_date,Projet,Salle ) VALUES ( " & Me.Interv_Ident_N°.Value & " ,'" & [Form_Menu_General].[M_Login] & "','" & Ma_fin & "','" & Ma_fin & "','" & Texte136 & "','" & Mon_Lib_Lign & "','" & Substr_Car_Intru(Me.Texte59) & "','" & Substr_Car_Intru(Me.Texte51) & "','" & Trim(Mid(Mon_Lib, InStr(1, Mon_Lib, ":") + 1, Len(Mon_Lib) - InStr(1, Mon_Lib, ":") + 1)) & " ');"
Else
DoCmd.RunSQL "INSERT INTO Interv_date ( N°,Origine,Ma_Date,Ma_date_Fin,Genesis,Type_Inter,Projet,Salle ) VALUES ( " & Me.Interv_Ident_N°.Value & " ,'" & [Form_Menu_General].[M_Login] & "','" & Ma_fin & "','" & Ma_fin & "','" & Texte136 & "','" & Mon_Lib_Lign & "','" & Substr_Car_Intru(Me.Texte51) & "','" & Trim(Mid(Mon_Lib, InStr(1, Mon_Lib, ":") + 1, Len(Mon_Lib) - InStr(1, Mon_Lib, ":") + 1)) & " ');"
End If
Else
MsgBox ("Accès non fait pour la date du " & Ma_fin & ". Il existe une entrée pour le n°: " & Texte136 & ". Merci de modifier la ligne si nécessaire.")
End If
Ma_fin = Ma_fin + 1
Wend
End Sub |
Partager