1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Dim db As Database, rs As Recordset, r As Long
Set db = OpenDatabase("C:\Users\c.dugue\Desktop\matthieu keip\Antares Managemnt\BDD.mdb")
' open the database
Set rs = db.OpenRecordset("Management", dbOpenTable)
' get all records in a table
With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("Projet") = UserForm1.ComboBox1
.Fields("Utilisateur") = UserForm1.ComboBox2
.Fields("Taches") = UserForm1.ComboBox3
.Fields("Temps") = UserForm1.TextBox1 & " : " & UserForm1.TextBox2
.Fields("Date") = Date
' add more fields if necessary...
.Update ' stores the new record
End With
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing |
Partager