BeforeAddNew Event

Occurs before a user adds a new record to the recordset.


Syntax

Private Sub object_BeforeAddNew(Cancel As Boolean, CancelMsg As String)

The syntax of the BeforeAddNew event has these parts:

PartDescription
objectA DGrid control.
Cancel  Set Cancel to True to cancel the AddNew operation. Default = False.
CancelMsg  If Cancel is set to True, the text to display to the user in the AddNew Canceled message box.

Remarks

If CancelMsg contains an empty string, the AddNew Canceled Message Box is not shown.  Use this event to validate entries of new records.

Data Type

Cancel  Boolean
CancelMsg  String