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
| Private Sub Command37_Click()
DoCmd.GoToRecord , , acNewRec
Dim fournRst As DAO.Recordset
Dim oRst1 As DAO.Recordset
Dim oRst2 As DAO.Recordset
Set fournRst = CurrentDb.OpenRecordset("Fournisseurs")
With fournRst
fournRst.Edit
Set oRst1 = .Fields("activite").Value
Set oRst2 = .Fields("contact").Value
With oRst1
.AddNew
.Fields(0) = DMax("id_fourn", "Fournisseurs", "") + 1
.Update
End With
With oRst2
.AddNew
.Fields(0) = DCount("contact", "Fournisseurs", "") + 1
.Update
End With
fournRst.Update
End With
fournRst.Close
MsgBox "Fournisseur Ajouter !", vbOKOnly
End Sub |
Partager