AdoRecordSetEvents:WillChangeRecord()

<< Click to Display Table of Contents >>

Navigation:  Ado Events > AdoRecordSetEvents Class >

AdoRecordSetEvents:WillChangeRecord()

Previous pageReturn to chapter overviewNext page

Purpose

The WillChangeRecord event is called before one or more records (rows) in the Recordset change.

 

Prototype

METHOD WillChangeRecord (lReason, lRecords, lStatus, oRecordSet ) CLASS AdoRecordSetEvents

 

Argument(s)

lReason        An EventReasonEnum value that specifies the reason for this event

lRecords        A Long value that indicates the number of records changing (affected).

lStatus        An AdoEventStatusEnum status value.

oRecordSet        A Recordset object. The Recordset for which this event occurred

 

 

Description

The lStatus parameter is set to adStatusOK if the operation that caused the event was successful. It is set to adStatusCantDeny if this event cannot request cancellation of the pending operation.

Before WillChangeRecord returns, set this parameter to adStatusCancel to request cancellation of the operation that caused this event.

A WillChangeRecord event may occur for the first changed field in a row due to the following Recordset operations: Update, Delete, CancelUpdate, AddNew, UpdateBatch, and CancelBatch. The value of the Recordset CursorType determines which operations cause the events to occur.

During the WillChangeRecord event, the Recordset Filter property is set to adFilterAffectedRecords. You cannot change this property while processing the event

 

See Also

AdoRecordSetEvents, AdoEventReasonEnum, AdoEventStatusEnum