Recordset.AddNew Method VBA Access
The Recordset.AddNew method is a function used for adding records to a recordset.
A Recordset object.
A 1 dimensional array of the variant type. This array must contain the Field names.
A 1 dimensional array of the variant type. This array must contain the field values of the new record.
As you can see the table has the following fields:
The following code will add a new record to the table:
Note: If you are working directly with an Access table, the values displayed in the table will not update automatically. One method would be to press “F5” to update the values being displayed in the table. For more information on this issue please see the link below:
You can download the file and code used in this article from the link below:
- Append Data to Table, Access VBA
- Microsoft MSDN: AddNew Method (ADO)
- Delete Record, Access VBA Recordset
- Read Data from Table, Access VBA
- Modify Existing Data in Table, Access VBA Recordsets