BeforeEdit Event

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


Syntax

Private Sub object_BeforeEdit(ByVal Row As Long ByVal Col as Long, OldVal As String, NewVal As String, Cancel As Boolean, CancelMsg As String)

The syntax of the BeforeEdit event has these parts:

PartDescription
objectA DGrid control.
Row   The row being edited.
Col   The column being edited.
OldVal   The text value of the original value.
NewVal   The text value entered by the user.
Cancel  Set Cancel to True to cancel the Edit operation. Default = False.
CancelMsg   If Cancel is set to True, the text to display to the user in the Edit Canceled message box.

Remarks

If CancelMsg contains an empty string, the Edit Canceled Message Box is not shown.  Use this event to validate entries or change user entered text.

Data Type

Row  Long
Col  Long
OldVal  String
NewVal  String
Cancel  Boolean
CancelMsg  String