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 36 37 38 39 40 41 42 43
| Option Explicit
Dim delta As String
Private Sub Command1_Click()
On Error Resume Next
Dim rs As String
Set conn = New ADODB.Connection
conn.Provider = "Microsoft.jet.OLEDB.3.51"
conn.ConnectionString = App.Path & "\dbRente.mdb"
conn.Open
Set rsIdentif = New ADODB.Recordset
rs = "Select * from Identif where [NumEregist]=" & (txtNr.Text)
rsIdentif.Open rs, conn, adOpenKeyset, adLockOptimistic, adCmdText
If txtNom.Text <> "" Or txtPrenom.Text <> "" Then
rsIdentif.AddNew
rsIdentif!NumEregist = txtNr.Text
rsIdentif!Nom = txtNom.Text
rsIdentif!Prenom = txtPrenom.Text
rsIdentif!DateNaissance = txtNaissance.Text
rsIdentif!DateAccident = txtAccident.Text
rsIdentif!Adresse = txtAdresse.Text
rsIdentif!Rente = txtRente.Text
rsIdentif!Employeur = txtEmployeur.Text
rsIdentif!Benificiaire = Combo1
rsIdentif!Nature = Combo2
rsIdentif!MontantAnnuel = txtMannuel.Text
rsIdentif!TauxIPP = txtTauxIpp.Text
rsIdentif!photo = Ima2.Picture
If txtImg = "" Then
Ima2.Picture = LoadPicture(App.Path & "\anonymous.jpg")
Else
Ima2.Picture = LoadPicture("" & txtImg & "")
End If
delta = Ima2.Width / Ima2.Height
'on fixe la largeur de l'image1 à sa taille maximale
Ima2.Width = 2300
rsIdentif.Update
Else
MsgBox ("Entrer le Nom, Prenom et adresse s´il vous plait!")
End If
Unload Me
Me.Show
End Sub |
Partager