1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
'Classe du formulaire
'----------------------------
Option Compare Database
Option Explicit
Private Sub Btn_Formulaire1_Click()
Dim strSQL As String
Dim lngRecordsAffected As Long
strSQL = "INSERT INTO Suivis_des_coupons (TP,Paye, Beneficiaire, CodeCoupon) "
strSQL = strSQL & "VALUES('" & Me!TP_Form & "','" & Me!Chkb_Paye & "','" & Me!Benef & "','" & Me!CodeCoup & "')"
If ConnectAndExecute(strSQL, True, lngRecordsAffected) Then
MsgBox "C'est OK, il y a eu " & lngRecordsAffected & " enregistrement(s) affecté(s)...", vbInformation
Else
MsgBox "Ooops, il y a eu une boulette !", vbExclamation
End If
End Sub |
Partager