Form.NewRecord property (Access)

Use the NewRecord property to determine whether the current record is a new record. Read-only Integer.

Syntax

expression.NewRecord

expression A variable that represents a Form object.

Remarks

The NewRecord property is read-only in Form view and Datasheet view. It'sn't available in Design view.

When a user has moved to a new record, the NewRecord property setting will be True whether or not the user has started to edit the record.

Example

The following example shows how to use the NewRecord property to determine if the current record is a new record. The NewRecordMark procedure sets the current record to the variable intnewrec. If the record is new, a message is displayed notifying the user of this. You could run this procedure when the Current event for a form occurs.

Sub NewRecordMark(frm As Form) 
 Dim intnewrec As Integer 
 
 intnewrec = frm.NewRecord 
 If intnewrec = True Then 
 MsgBox "You're in a new record." _ 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.