Nouvel enregistrement prnd la place d'un exixtant dans la table
1 réponse
Marie-Claire
Bonjour,
Décidément 2010 n'est pas une année pour moi.
Je dois faire un agenda et pour cela je m'inspire de agendamedv3.1 que j'ai
trouvé sur http://denishulo.developpez.com/tutoriels/access/planningv1/
Cette application prévoit qu'au clic sur une case planning le formulaire
Patient s'ouvre pour créer le rdv.
Or pour des raisons de lecture des indications sur le mémo je dois avoir les
deux formulaires ouverts simultanément, alors dans le formulaire planning
j'ai introduit le formulaire Patient en sous formulaire.
Problème les nouvelles saisies de rdv s'inscrivent dans la table
T_RendezVous en en effaçant un autre.
C'est-à dire que je ne crée jamais de nouveau rendez-vous.
Voici les codes:
Lorsque l'on clique sur une plage du planning:
la fonction OuvrirFormRendezVous
Public Function OuvrirFormRendezVous(i As Integer, j As Integer)
Dim DateC As Date
Dim DateD As Date
Dim DateF As Date
Set RsPL = CurrentDb.OpenRecordset(LeSql, dbOpenForwardOnly)
Forms!F_Planning!Titre.Caption = "PLANNING DE LA SEMAINE DU " &
UCase(Format(DateDebut, "dd mmmm yyyy")) & " AU " & UCase(Format(DateDebut +
6, "dd mmmm yyyy"))
Forms!F_Planning!DateD.Value = Date
InitPlanning
Do While Not (RsPL.EOF)
If Not IsNull(RsPL!Couleur) Then
Color = RsPL!Couleur
Else
Color = vbWhite
End If
If DateDiff("d", RsPL!HoraireDebut, RsPL!HoraireFin) = 0 Then
Col = IndiceColonne(RsPL!HoraireDebut)
Ligne = PremierCreneau(RsPL!HoraireDebut)
d = DateDiff("n", RsPL!HoraireDebut, RsPL!HoraireFin) \ 15
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Height = 295 * d
If Not IsNull(RsPL!NP) Then
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Caption = CentrerTexte(RsPL!Residant, d)
Else
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Caption = CentrerTexte(Nz(RsPL!Memo, ""), d)
End If
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).BackColor = Color
Else
MajCongé RsPL!HoraireDebut, RsPL!HoraireFin, RsPL!Memo, Color
End If
RsPL.MoveNext
Loop
RsPL.Close
Set RsPL = Nothing
End Sub
'-----------------------------------------------------------------------------------------------------------------
la fonction InitPlanning
Private Sub InitPlanning()
Dim i As Integer, j As Integer
Dim DateC As Date ' date courante qui prend successivement les valeurs des
jours de la semaine
For i = 1 To 40
For j = 1 To 7
If (Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption <>
"") Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption = ""
End If
If (i Mod 2) = 1 Then ' on alterne les couleurs de lignes
If Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor <> -2147483624 Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor = -2147483624
End If
Else
If Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor <> vbWhite Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor = vbWhite
End If
End If
If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height <>
295 Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height =
295 ' on définit la hauteur des lignes
End If
If EstFerie(DateC) Or Not (EstWeek(DateC)) Then 'on colorie les en-têtes
(rouge pour les week-end)
Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761087
ColorierColonne i, 16772351
Else
Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761024
End If
Next i
End Sub
Est-ce que vous avez le truc, ou est-ce que vous voyez l’erreur que j’ai pu
faire.
Merci d’avance.
Marie-Claire
Mouais j'ai pas l'impression que tu t'inspire de agendamedv3.1 mais plutôt que tu cherche à le modifier pour qu'il correponde à ton besoin, as-tu essayer de contacter le concepteur ?
Cette application prévoit qu'au clic sur une case planning le formulaire Patient s'ouvre pour créer le rdv. Or pour des raisons de lecture des indications sur le mémo je dois avoir les deux formulaires ouverts simultanément, alors dans le formulaire planning j'ai introduit le formulaire Patient en sous formulaire. Problème les nouvelles saisies de rdv s'inscrivent dans la table T_RendezVous en en effaçant un autre. C'est-à dire que je ne crée jamais de nouveau rendez-vous. Voici les codes:
Lorsque l'on clique sur une plage du planning:
la fonction OuvrirFormRendezVous
Public Function OuvrirFormRendezVous(i As Integer, j As Integer)
Dim DateC As Date Dim DateD As Date Dim DateF As Date
Set RsPL = CurrentDb.OpenRecordset(LeSql, dbOpenForwardOnly)
Forms!F_Planning!Titre.Caption = "PLANNING DE LA SEMAINE DU " & UCase(Format(DateDebut, "dd mmmm yyyy")) & " AU " & UCase(Format(DateDebut + 6, "dd mmmm yyyy")) Forms!F_Planning!DateD.Value = Date
InitPlanning
Do While Not (RsPL.EOF)
If Not IsNull(RsPL!Couleur) Then Color = RsPL!Couleur
Else Color = vbWhite
End If
If DateDiff("d", RsPL!HoraireDebut, RsPL!HoraireFin) = 0 Then
Col = IndiceColonne(RsPL!HoraireDebut) Ligne = PremierCreneau(RsPL!HoraireDebut)
d = DateDiff("n", RsPL!HoraireDebut, RsPL!HoraireFin) 15
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Height = 295 * d
If Not IsNull(RsPL!NP) Then Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Caption = CentrerTexte(RsPL!Residant, d) Else Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Caption = CentrerTexte(Nz(RsPL!Memo, ""), d) End If
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).BackColor = Color
Else
MajCongé RsPL!HoraireDebut, RsPL!HoraireFin, RsPL!Memo, Color
End If
RsPL.MoveNext Loop
RsPL.Close Set RsPL = Nothing
End Sub '----------------------------------------------------------------------------------------------------------------- la fonction InitPlanning
Private Sub InitPlanning()
Dim i As Integer, j As Integer Dim DateC As Date ' date courante qui prend successivement les valeurs des jours de la semaine
For i = 1 To 40
For j = 1 To 7
If (Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption <> "") Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption = "" End If
If (i Mod 2) = 1 Then ' on alterne les couleurs de lignes If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor <> -2147483624 Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor = -2147483624 End If Else If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor <> vbWhite Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor = vbWhite End If End If
If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height <> 295 Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height = 295 ' on définit la hauteur des lignes End If
If EstFerie(DateC) Or Not (EstWeek(DateC)) Then 'on colorie les en-têtes (rouge pour les week-end) Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761087 ColorierColonne i, 16772351 Else Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761024 End If
Next i
End Sub
Est-ce que vous avez le truc, ou est-ce que vous voyez l’erreur que j’ai pu faire. Merci d’avance. Marie-Claire
Bonjour,
Marie-Claire a écrit :
Bonjour,
Décidément 2010 n'est pas une année pour moi.
Je dois faire un agenda et pour cela je m'inspire de agendamedv3.1 que j'ai
trouvé sur http://denishulo.developpez.com/tutoriels/access/planningv1/
Mouais j'ai pas l'impression que tu t'inspire de agendamedv3.1 mais
plutôt que tu cherche à le modifier
pour qu'il correponde à ton besoin, as-tu essayer de contacter le
concepteur ?
Cette application prévoit qu'au clic sur une case planning le formulaire
Patient s'ouvre pour créer le rdv.
Or pour des raisons de lecture des indications sur le mémo je dois avoir les
deux formulaires ouverts simultanément, alors dans le formulaire planning
j'ai introduit le formulaire Patient en sous formulaire.
Problème les nouvelles saisies de rdv s'inscrivent dans la table
T_RendezVous en en effaçant un autre.
C'est-à dire que je ne crée jamais de nouveau rendez-vous.
Voici les codes:
Lorsque l'on clique sur une plage du planning:
la fonction OuvrirFormRendezVous
Public Function OuvrirFormRendezVous(i As Integer, j As Integer)
Dim DateC As Date
Dim DateD As Date
Dim DateF As Date
Set RsPL = CurrentDb.OpenRecordset(LeSql, dbOpenForwardOnly)
Forms!F_Planning!Titre.Caption = "PLANNING DE LA SEMAINE DU " &
UCase(Format(DateDebut, "dd mmmm yyyy")) & " AU " & UCase(Format(DateDebut +
6, "dd mmmm yyyy"))
Forms!F_Planning!DateD.Value = Date
InitPlanning
Do While Not (RsPL.EOF)
If Not IsNull(RsPL!Couleur) Then
Color = RsPL!Couleur
Else
Color = vbWhite
End If
If DateDiff("d", RsPL!HoraireDebut, RsPL!HoraireFin) = 0 Then
Col = IndiceColonne(RsPL!HoraireDebut)
Ligne = PremierCreneau(RsPL!HoraireDebut)
d = DateDiff("n", RsPL!HoraireDebut, RsPL!HoraireFin) 15
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Height = 295 * d
If Not IsNull(RsPL!NP) Then
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Caption = CentrerTexte(RsPL!Residant, d)
Else
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).Caption = CentrerTexte(Nz(RsPL!Memo, ""), d)
End If
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" &
Col).BackColor = Color
Else
MajCongé RsPL!HoraireDebut, RsPL!HoraireFin, RsPL!Memo, Color
End If
RsPL.MoveNext
Loop
RsPL.Close
Set RsPL = Nothing
End Sub
'-----------------------------------------------------------------------------------------------------------------
la fonction InitPlanning
Private Sub InitPlanning()
Dim i As Integer, j As Integer
Dim DateC As Date ' date courante qui prend successivement les valeurs des
jours de la semaine
For i = 1 To 40
For j = 1 To 7
If (Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption <>
"") Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption = ""
End If
If (i Mod 2) = 1 Then ' on alterne les couleurs de lignes
If Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor <> -2147483624 Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor = -2147483624
End If
Else
If Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor <> vbWhite Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" &
j).BackColor = vbWhite
End If
End If
If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height <>
295 Then
Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height =
295 ' on définit la hauteur des lignes
End If
If EstFerie(DateC) Or Not (EstWeek(DateC)) Then 'on colorie les en-têtes
(rouge pour les week-end)
Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761087
ColorierColonne i, 16772351
Else
Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761024
End If
Next i
End Sub
Est-ce que vous avez le truc, ou est-ce que vous voyez l’erreur que j’ai pu
faire.
Merci d’avance.
Marie-Claire
Mouais j'ai pas l'impression que tu t'inspire de agendamedv3.1 mais plutôt que tu cherche à le modifier pour qu'il correponde à ton besoin, as-tu essayer de contacter le concepteur ?
Cette application prévoit qu'au clic sur une case planning le formulaire Patient s'ouvre pour créer le rdv. Or pour des raisons de lecture des indications sur le mémo je dois avoir les deux formulaires ouverts simultanément, alors dans le formulaire planning j'ai introduit le formulaire Patient en sous formulaire. Problème les nouvelles saisies de rdv s'inscrivent dans la table T_RendezVous en en effaçant un autre. C'est-à dire que je ne crée jamais de nouveau rendez-vous. Voici les codes:
Lorsque l'on clique sur une plage du planning:
la fonction OuvrirFormRendezVous
Public Function OuvrirFormRendezVous(i As Integer, j As Integer)
Dim DateC As Date Dim DateD As Date Dim DateF As Date
Set RsPL = CurrentDb.OpenRecordset(LeSql, dbOpenForwardOnly)
Forms!F_Planning!Titre.Caption = "PLANNING DE LA SEMAINE DU " & UCase(Format(DateDebut, "dd mmmm yyyy")) & " AU " & UCase(Format(DateDebut + 6, "dd mmmm yyyy")) Forms!F_Planning!DateD.Value = Date
InitPlanning
Do While Not (RsPL.EOF)
If Not IsNull(RsPL!Couleur) Then Color = RsPL!Couleur
Else Color = vbWhite
End If
If DateDiff("d", RsPL!HoraireDebut, RsPL!HoraireFin) = 0 Then
Col = IndiceColonne(RsPL!HoraireDebut) Ligne = PremierCreneau(RsPL!HoraireDebut)
d = DateDiff("n", RsPL!HoraireDebut, RsPL!HoraireFin) 15
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Height = 295 * d
If Not IsNull(RsPL!NP) Then Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Caption = CentrerTexte(RsPL!Residant, d) Else Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).Caption = CentrerTexte(Nz(RsPL!Memo, ""), d) End If
Forms!F_Planning!Planning.Form("creneau" & Ligne & "_" & Col).BackColor = Color
Else
MajCongé RsPL!HoraireDebut, RsPL!HoraireFin, RsPL!Memo, Color
End If
RsPL.MoveNext Loop
RsPL.Close Set RsPL = Nothing
End Sub '----------------------------------------------------------------------------------------------------------------- la fonction InitPlanning
Private Sub InitPlanning()
Dim i As Integer, j As Integer Dim DateC As Date ' date courante qui prend successivement les valeurs des jours de la semaine
For i = 1 To 40
For j = 1 To 7
If (Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption <> "") Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Caption = "" End If
If (i Mod 2) = 1 Then ' on alterne les couleurs de lignes If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor <> -2147483624 Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor = -2147483624 End If Else If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor <> vbWhite Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).BackColor = vbWhite End If End If
If Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height <> 295 Then Forms!F_Planning!Planning.Form("creneau" & i & "_" & j).Height = 295 ' on définit la hauteur des lignes End If
If EstFerie(DateC) Or Not (EstWeek(DateC)) Then 'on colorie les en-têtes (rouge pour les week-end) Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761087 ColorierColonne i, 16772351 Else Forms!F_Planning!Planning.Form("Col" & i).BackColor = 16761024 End If
Next i
End Sub
Est-ce que vous avez le truc, ou est-ce que vous voyez l’erreur que j’ai pu faire. Merci d’avance. Marie-Claire