ComponentOne True DataControl 8.0
RecordChangeComplete Event

 

RecordChangeComplete Event

Occurs after a record has been added/deleted/updated/restored.

Syntax

TData_RecordChangeComplete (ByVal adReason As EventReasonEnum, ByVal cRecords As Long, ByVal pError As ADODB.Error, adStatus As EventStatusEnum)

Remarks

Arguments: adReason is an ADO EventReasonEnum value that specifies the reason for this event. Its value can be adRsnAddNew, adRsnDelete, adRsnUpdate, adRsnUndoUpdate, adRsnUndoAddNew, adRsnUndoDelete, or adRsnFirstChange.

cRecords is a Long integer: the number of records changed (affected).

pError is an ADO Error object. It describes the error that occurred if the value of adStatus is adStatusErrorsOccurred; otherwise it is not set.

adStatus is an ADO EventStatusEnum status variable. When RecordChangeComplete is called, this parameter is set toadStatusOK if the operation that caused the event was successful, or adStatusErrorsOccurred if the operation failed.

The RecordChangeComplete event is a standard ADO Recordset event fired by the TData control’s Recordset. For more information, see Using recordset events. As with any ADO recordset, this event occurs after one or more records (rows) in the recordset change. It is also fired when an operation has attempted to change one or more records, and failed. This case can be detected by the value of the adStatus argument, it is set to adStatusErrorsOccurred if the operation failed.

The RecordChangeComplete event may occur due to the following Recordset operations: Update, Delete, CancelUpdate, AddNew, UpdateBatch, and CancelBatch.

Notes:

(1) The RecordChangeComplete event is fired for the current row of the TData control (except the case (2) below). You can use this event to set field values or perform any other possible actions on the current recordset row.

(2) When RecordChangeComplete event occurs with adReason=adRsnAddNew (in other words, after a new row has been added to the recordset), the TData control is not yet positioned on the newly added row. If you need to perform some actions requiring certain row position (such as setting TData field values), use the MoveComplete event instead, testing for TData.Recordset.EditMode=adEditAdd.

See Also

TData Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback