III.2.2.2. Quelques procédures de traitement
Nous présenterons ici quelques codes
implémentant les boutons "Enregistrer" des onglets : " DECLARANT ", et
« DECLARATION »
Private Sub cmdEnrgistrerDecl_Click()
If Me.nomd <> "" And Me.qualited <> "" And Me.lienced
<> "" And Me.datnced <> "" And Me.profd <> "" And Me.adresd
<> "" Then
Set dba = CurrentDb
Set rc = dba.OpenRecordset("DECLARANT", dbOpenTable) rc.AddNew
Private Sub cmdSaveDeclaration_Click()
-' 56 -'
rc!nomd = Me.nomd
rc!qualited = Me.qualited
rc!lienced = Me.lienced
rc!datnced = Me.datnced
rc!profd = Me.profd
rc!adresd = Me.adresd
rc.Update
rc.Close
dba.Close
MsgBox " Enregistrement effectué "
Me.nomd = "" : Me.qualited = "" : Me.lienced = "" : Me.datnced =
""
Me.profd = "" : Me.adresd = "" : Me.pEnf.Enabled = True
Me.Refresh
Else
MsgBox " Veuillez remplir tous les svp! ", vbInformation, "
Saisie déclarant"
End If
End Sub
-' 57 -'
If Me.jourdecl <> "" And Me.moidecl <> "" And
Me.annedecl <> "" And Me.heurdecl <> "" And Me.nomoff <> ""
And Me.langdecl <> "" And Me.Idd <> "" And Me.Idenf <> "" And
Me.Idm <> "" And Me.Idp <> "" Then
Set dba = CurrentDb
Set rc = dba.OpenRecordset("DECLARATION", dbOpenTable)
rc.AddNew
rc!numdecl = Me.numdecl : rc!jourdecl = Me.jourdecl rc!moidecl =
Me.moidecl : rc!annedecl = Me.annedecl rc!heurdecl = Me.heurdecl : rc!nomoff =
Me.nomoff rc!langdecl = Me.langdecl : rc!Idenf = Me.Idenf rc!Idd = Me.Idd :
rc!Idp = Me.Idp : rc!Idm = Me.Idm rc.Update : rc.Close : dba.Close
MsgBox " Enregistrement effectué avec succès ",
vbInformation, " Saisie Déclaration"
If MsgBox("Voulez-vs enregistrer un autre enfant?", vbYesNo +
vbQuestion, "Enregistrement") = vbYes Then
Me.numdecl = Me.numdecl.Value + 1 Me.jourdecl = "" : Me.moidecl =
"" Me.annedecl = "" : Me.heurdecl = "" Me.nomoff = "" : Me.langdecl = "" Me.Idd
= Null : Me.Idenf = Null Me.Idm = "" : Me.Idp = ""
-' 58 -'
Else
DoCmd.Close
DoCmd.OpenForm "menu" End If
Me.Refresh
Else
MsgBox " Veuillez remplir tous les svp!", vbInformation, "Saisie
Déclaration" End If
End Sub
-' 59 -'
|