Syntax
| WillChangeRecord(adReason, cRecord, adStatus, pRecordset)
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Called before one or more rows are to be changed.
The WillChangeRecord event can be fired before the values for one or more Records in the Recordset have been changed.
The operations that can trigger this event would be either:
In contrast, the RecordChangeComplete event can be fired after any changes in the values for one or more Record 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 four parameters passed to this event.
EventReasonEnum Constants
EventStatusEnum Constants
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
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_WillChangeRecord(adReason As ADODB.EventReasonEnum, _
cRecord As Long, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset )
' place any code you desire here, for example
Print cRecord & " records will be modified"
End Sub
|