ADODB Object
 
Syntax
 
FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset)
 
Description
Called after the values of one or more Field objects have been changed.
 
The FieldChangeComplete event can be fired after the values for one or more Field objects have been changed.
 
In contrast, the WillChangeField event can be fired before any pending changes in the values for one or more Field objects have been completed.
 
An event is simply a subroutine that can be called automatically after a specific operation has occurred. This subroutine can contain any code that you need to run when the event occurs. The subroutine will only be called if it is included in your code.
 
There are five parameters passed to this event.
 
The adStatus parameter is one of the EventStatusEnum constants that describes the current status of the event.
 
Parameter
Description
cFields
The cFields parameter is a long value that is the number of Field objects in the Fields parameter array.
Fields
The Fields parameter is a variant array of Field objects that have had their values changed.
pError
The pError parameter will be set only if an error occurred and the adStatus is set to adStatusErrorsOccurred. It is an Error object that describes the error.
adStatus
The adStatus parameter is one of the EventStatusEnum constants that describes the current status of the event.
pRecordset
The pRecordset parameter is the Recordset object to which this event applies.
 
 
EventStatusEnum Constants 
 
Constant
Value
Description
adStatusCancel
4
Cancels the operation that fired the event
adStatusCantDeny
3
Cannot cancel pending operation
adStatusErrorsOccurred
2
Indicates that warnings and/or errors occurred
adStatusOK
1
The operation that fired the event was successful
adStatusUnwantedEvent
5
The operation that generated the event cannot generate future events
See Also
Example
 
' Use the WithEvents keyword to designate that events
' can be handled by this Recordset object
Dim WithEvents objRecSet As ADODB.Recordset
 
' Note how the object name, objRecSet, is incorporated into the event Sub name
Private Sub objRecSet_FieldChangeComplete( cFields As Long, _
   Fields As Variant, _
   ByVal pError As ADODB.Error, _
   adStatus As ADODB.EventStatusEnum, _
   ByVal pRecordset As ADODB.Recordset )
 
' place any code you desire here, for example
If adStatus = adStatusErrorsOccurred Then
   Dim objError As ADODB.Error
   For Each objError in pRecordset.Errors
      Debug.Print vbtab; objError.Description
   Next
End If
 
End Sub