1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub Command2_Click()
'Instanciation de variable
Set rst = New ADODB.Recordset
Set cnx = New ADODB.Connection
Call Connexion(cnx)
rst.Open "INSERT INTO Versement(mat_vers, num_vers, type_vers, date, montant, mat_mem, mat_cpt) VALUES ('" & txtv(8).Text & "', '" & txtv(9).Text & "', '" & Combo2.Text & "', '" & txtv(11).Text & "', '" & txtv(10).Text & "', '" & Form1.Text1(0).Text & "', '" & Form2.Text1(0).Text & "') ", cnx, adOpenKeyset, adLockOptimistic, adCmdText
'Ferme la connexion
cnx.Close
If MsgBox("Faire un autre Versement ?", vbYesNo + vbExclamation, " NOUVEAU COMPTE !") = vbYes Then
VerseForm.Show
Else
MsgBox "Opération terminée avec succes !", vbExclamation
Exit Sub
'Ferme la feuille courante
Unload Me
End If
End Sub |
Partager