Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
FieldChangeComplete Event
Error Object
Field Object
Update Method
Field Value Method
Recordset Object
EVENT: Recordset::WillChangeField
WillChangeField
(cFields, Fields, adStatus, pRecordset)
The
WillChangeField
event can be fired before any pending changes in the values for one or more
Field
objects have been completed.
In contrast, the
FieldChangeComplete
event can be fired after the values for one or more
Field
objects have been changed.
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.
The
cFields
parameter is a long value that is the number of
Field
objects in the
Fields
parameter array.
The
Fields
parameter is a variant array of
Field
objects that have had their values changed.
The
adStatus
parameter is one of the
EventStatusEnum
constants that describes the current status of the event.
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
The
pRecordset
parameter is the
Recordset
object to which this event applies.
Code (Visual Basic):
' 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_
WillChangeField
( cFields As Long, _
Fields As Variant, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset )
' place any code you desire here, for example
Print cFields & " will be modified"
End Sub
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information