1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub insert_Click()
On Error GoTo Err_insert_Click
CiviliteClient = Me.Civilite.Value
NomClient = Me.Nom.Value
PrenomClient = Me.Prenom.Value
AdresseClient = Me.Adresse.Value
CPClient = Me.CodePostal.Value
VilleClient = Me.Ville.Value
DoCmd.RunSQL "INSERT INTO [TBClient] (Civilite, Nom, Prenom, Adresse, CodePostal, Ville)" & _
"VALUES (CiviliteClient, NomClient, PrenomClient, AdresseClient, CPClient, VilleClient)" & _
"INSERT INTO [TBUpdate] (DateUpdate, Civilite, Nom, Prenom, Adresse, CodePostal, Ville)" & _
"VALUES (Now, CiviliteClient, NomClient, PrenomClient, AdresseClient, CPClient, VilleClient)"
Exit_insert_Click:
Exit Sub
Err_insert_Click:
MsgBox "Erreur lors de l'ajout d'un client !!!"
Resume Exit_insert_Click
End Sub |
Partager