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 36
| DoCmd.SetWarnings False
Dim db As Database
Dim rs As Recordset
Dim compte As Integer
Dim i As Integer
i = 1
compte = DCount("[ID projet]", "projets")
MsgBox compte
Set db = CurrentDb()
Set rs = db.OpenRecordset("projets")
DoCmd.GoToRecord , , acFirst
typep = Left([ID projet], 1)
For i = 1 To compte
If typep = "a" Or typep = "s" Or typep = "x" Or typep = "i" Then
DoCmd.RunSQL "insert into tâches (id, tâches, responsable, section, ssection) VALUES ([id projet], [txt_tâches], [liste_responsable],[liste_section], [liste_ss])"
DoCmd.GoToRecord , , acNext
typep = Left([ID projet], 1)
Else
DoCmd.GoToRecord , , acNext
typep = Left([ID projet], 1)
End If
Next
DoCmd.RunSQL "delete * from tâches where [id]='A - VISION STRATÉGIQUE' and [tâches]='" & txt_tâches & "' "
DoCmd.RunSQL "delete * from tâches where [id]='A - divers' and [tâches]='" & txt_tâches & "' "
If liste_blank = "blank- A" Then
DoCmd.RunSQL "insert into tâches (id, tâches, responsable, section, ssection) VALUES ('BLANK- A', [txt_tâches], [liste_responsable],[liste_section], [liste_ss])"
Else
If liste_blank = "blank- s" Then
DoCmd.RunSQL "insert into tâches (id, tâches, responsable, section, ssection) VALUES ('BLANK- S', [txt_tâches], [liste_responsable],[liste_section], [liste_ss])"
Else
If liste_blank = "blank- x" Then
DoCmd.RunSQL "insert into tâches (id, tâches, responsable, section, ssection) VALUES ('BLANK- X', [txt_tâches], [liste_responsable],[liste_section], [liste_ss])"
End If
End If
End If
DoCmd.SetWarnings True |
Partager