The WillChangeRecordset method is called before a pending operation changes the Recordset. The RecordsetChangeComplete method is called after the Recordset has changed.
Syntax
WillChangeRecordset adReason, adStatus, pRecordset
RecordsetChangeComplete adReason, pError, adStatus, pRecordset
Parameters
adReason An EventReasonEnum value. Specifies the reason for this event. Its value can be adRsnReQuery, adRsnReSynch, adRsnClose, adRsnOpen.
adStatus An EventStatusEnum status value.
When WillChangeRecordset is called, this parameter is set to adStatusOK if the operation that caused the event was successful. It is set to adStatusCantDeny if this method cannot request cancellation of the pending operation.
When RecordsetChangeComplete is called, this parameter is set to adStatusOK if the operation that caused the event was successful, adStatusErrorsOccurred if the operation failed, or adStatusCancel if the operation associated with the previously accepted WillChangeRecordset event has been canceled.
Before WillChangeRecordset returns, set this parameter to adStatusCancel to request cancellation of the pending operation.
Before WillChangeRecordset or RecordsetChangeComplete returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications.
pError An Error object. It describes the error that occurred if the value of adStatus is adStatusErrorsOccurred; otherwise it is not set.
pRecordset A Recordset object. The Recordset for which this event occurred.
Remarks
A WillChangeRecordset or RecordsetChangeComplete event may occur due to the following Recordset operations: Requery, Resync, Close, Open, and Filter.