Show All

# Delete Method

Deletes the specified Error object from the Errors collection.

expression.Delete(ByVal varNode As Variant, ByVal bstrConditionName As String)

expression Required. An expression that returns a reference to the Errors collection.

varNode Required Variant. The XML Document Object Model (DOM) node associated with the error.

bstrConditionName Required String. The name of the error.

## Security Level

2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

## Remarks

The Delete method deletes all the Error objects in the Errors collection that are associated with the specified XML node and that have the same name. To delete all of the Error objects contained in the Errors collection, use the DeleteAll method.

Note The Delete method will only delete errors that were created using the Add method of the Errors collection. It cannot be used to delete errors that occur because of schema or data validation constraints, or errors that were created using the ReportError method of the DataDOMEvent object.

## Example

In the following example, the Delete method of the Errors collection is used to delete all the errors based on their associated XML node and name:

    XDocument.Errors.Delete(MyXMLNode, "ValidationError");

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp