Table of contents
Collapse the table of content
Expand the table of content

Determine Whether The Current Record is a New Record In a Form

office 365 dev account|Last Updated: 4/3/2018
3 Contributors

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 notifies the user. You could call this procedure when theCurrent 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." _ 
        &; "@Do you want to add new data?" _ 
        &; "@If not, move to an existing record." 
    End If 
End Sub
© 2018 Microsoft