AddNew Method

See AlsolanAddNewSee


Clears the copy bufferKBPE86 in preparation for creating a new record in a TableK31GNT or DynasetUDR386.




The AddNew method uses these parts:

Part                 Description


recordset          The Recordset2D16TH3 property of a data control; in the Professional Edition, can be an object variableZ3R9Q5 that identifies a Table or Dynaset.  If recordset does not exist or is not open, an error occurs.


The AddNew method sets all fields in the copy buffer to Null1DDW7C0 and makes it the current record1BNJB8X.  After putting data in the record, use the Update3VBH5SE method to add the record to the recordset.  If you add a record to a Table, the record does not immediately appear in any currently existing Dynaset based on that Table.  If you add a record to a Dynaset, however, the record immediately appears in the underlying Table.

While already editing a new record, using AddNew again clears any changes made to fields in the copy buffer since the last AddNew.  With a data control, if an Edit or AddNew operation is pending when you use one of the Find or Move methods or close the recordset, Update is automatically invoked if not stopped during the Validate1N4H0WG event.

The new record's apparent position in the recordset depends on whether you add new records to a Table or a Dynaset.  If you add a new record to a Table, the new record appears in its position in the table according to the current index.  If you add a new record to a Dynaset, the new record appears at the end of the Dynaset.

When you use the Update method after AddNew, the record that was current before you executed AddNew becomes the current record again, and the new record is added to the recordset.  To make the new record current after you use Update:

         Set the Bookmark equal to the LastModified property.

         Use MoveLast1BPKDY5 with a Dynaset or a Table that does not have an index.

         In the Professional Edition, use Seek with a Table that has an index.


Caution   In the Professional Edition, if you are not using a data control and use one of the Find or Move methods or close the recordset while an Edit or AddNew operation is pending, any existing changes will be lost and no error will occur.


In a multiuser environment with the recordset's LockEdits property set to True, using Edit or AddNew locks the pageAP754UT until after Update has completed the updating process.  If the LockEdits property is False, the page is not locked until the actual Update operation.