OnAfterChange Event
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

DataDOM.OnAfterChange Event

Office 2007
Occurs after changes to a form's underlying XML document have been accepted and after the OnValidate event has occurred.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.OnAfterChange(pDataDOMEvent)

expression   An expression that returns a DataDOM object.

Parameters

NameRequired/OptionalData TypeDescription
pDataDOMEventRequiredDataDOMEventAn event object that is used during Microsoft Office InfoPath 2007 data validation events.

Return Value
nothing

Remarks

This event handler does not allow users to cancel an operation.

The OnAfterChange event is typically used for changing data in a form after other changes have occurred—for example, making calculations or changing the structure of a form's underlying XML document.

Bb229732.vs_note(en-us,office.12).gif  Note
In some cases, events related to changes in a form's underlying XML document may occur more than once. For example, when existing data is changed, an insert and delete operation occurs.

Example

In the following example, the OnAfterChange event handler is used to call a custom function that performs calculations:

JScript
function msoxd__ContactDates::OnAfterChange eventObj)
{
   if (eventObj.IsUndoRedo)
   {
      // An undo or redo operation has occurred and the DOM is read-only.
      return;
   }
   CalculateTotalCampaignCost();
}



Show:
© 2016 Microsoft