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
|
Private Sub BTN_REC_MENU_Click()
On Error GoTo Err_BTN_REC_MENU_Click
Dim S_REQ1 As String
Dim S_REQ2 As String
Dim S_REQ As String
S_REQ1 = "INSERT INTO TAB_Suivi_CGPS_CRC ( Année, Mois, Jour, Num_Dossier_Attribué, Type_Demande, Nom, Prénom, Statut, Situation, Nb_Cartes_Demandées, Dossier_Complet, Dossier_Incomplet, Justificatif_Manquant_1, 2Justificatif_Manquant_1, Justificatif_Manquant_3, Justificatif_Manquant_4, Date_Envoi_Courrier, Cartes_Accordées, Cartes_Accordées_Sur_Dérogation, Cartes_Refusées, Motif_Refus, Demandes_Classées_Sans_Suite, Cartes_Délivrées, Num_Carte, Date_Début_Validité_Carte, [Date_Envoi_Cartes-duplicata_Courrier_Refus_Classement_dossier], Observations )"
S_REQ2 = "values ('" & Me.Année.Value & "', '" & Me.Mois.Value & "', '" & Me.Jour.Value & "', '" & Me.Num_Dossier.Value & "', '" & Me.Type_demande.Column(1) & "', '" & Me.Nom.Value & "', '" & Me.Prenom.Value & "', '" & Me.Statut.Column(1) & "', '" & Me.Situation.Column(1) & "', '" & Me.Nb_Cartes_Demandées.Value & "', '" & Me.Dossier_complet.Value & "', '" & Me.Dossier_incomplet.Value & "', '" & Me.Justificatif_manquant_1.Column(1) & "', '" & Me.Justificatif_manquant_2.Column(1) & "', '" & Me.Justificatif_manquant_3.Column(1) & "', '" & Me.Justificatif_manquant_4.Column(1) & "', '" & Me.Date_envoi_courrier.Value & "', '" & Me.Cartes_Accordées.Value & "', '" & Me.Cartes_accordées_sur_dérogation.Value & "', '" & Me.Cartes_refusées.Value & "', '" & Me.Motif_Refus.Column(1) & "', '" & Me.Demandes_classées_sans_suite.Value & "', '" & Me.Cartes_délivrées.Value & "', '" & Me.Num_Carte.Value & "', '" & Me.Date_Debut_Validité_Carte.Value & "', '" & Me.Date_Envoi_Carte.Value & "', '" & Me.Observations.Value & "');"
S_REQ = S_REQ1 & S_REQ2
Dim MyDB As DAO.Database
Set MyDB = CurrentDb()
MyDB.Execute S_REQ
MsgBox "Saisie enregistrée dans la table"
' Vidage des champs Texte (TODO : A Verifier si nécessaire)
Dim Cmp As Control
For Each Cmp In Me.Controls
If Cmp.ControlType = acTextBox Then Cmp.Value = ""
Next Cmp
' Fermeture du formaulaire
DoCmd.Close
Exit_BTN_REC_MENU_Click:
Exit Sub
Err_BTN_REC_MENU_Click:
MsgBox Err.Description
Resume Exit_BTN_REC_MENU_Click
End Sub |
Partager