OnAfterChange Event

Microsoft Office InfoPath

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

Function node::OnAfterChange(ByRef pDataDOMEvent As DataDOMEvent)

pDataDOMEvent Required DataDOMEvent. A reference to the DataDOMEvent object.

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.

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 from the Events developer sample form, the OnAfterChange event handler is used to call a custom function that performs calculations:

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