Share via


DataDOMEvent.ReturnStatus Property

Gets or sets a value indicating the return status of the data validation event.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

Syntax

'Declaration
'Usage

Remarks

For the OnBeforeChange event, if the ReturnStatus property is set to false, the changes to the XML Document Object Model (DOM) node are not accepted and the data validation event fails. If set to true, no data validation error has occurred and the data validation event is successful.

Example

In the following example, the ReturnStatus property of the DataDOMEventObject object is used to indicate that the data validation event was not successful. The code also uses the ReturnMessage property of the DataDOMEventObject object to display a message to the user.

public void RepVisitDt_OnBeforeChange(DataDOMEvent e)
{
 if (e.NewValue.ToString() == "")
 {
  e.ReturnMessage = "You must supply a value for this field.";
  e.ReturnStatus = false;
 }
}

See Also

Reference

DataDOMEvent Interface
DataDOMEvent Members
Microsoft.Office.Interop.InfoPath Namespace