Add Method (FormatConditions Collection)

Add Method (FormatConditions Collection)

See Also                  Applies To

You can use the Add method to add a conditional format as a FormatCondition object to the FormatConditions collection of a combo box or text box control.

Syntax

object.Add type [, operator][, expression1][, expression2]

The Add method has the following arguments.

Argument Description
object A string expression that evaluates to the FormatConditions collection of a combo box or text box control.
type One of the following intrinsic constants:

acExpression
acFieldHasFocus
acFieldValue

operator One of the following intrinsic constants:

acBetween (default)
acEqual
acGreaterThan
acGreaterThanOrEqual
acLessThan
acLessThanOrEqual
acNotBetween
acNotEqual

  If the type argument is acExpression, the operator argument is ignored. If you leave this argument blank, the default constant (acBetween) is assumed.
expression1 A Variant value or expression associated with the first part of the conditional format. Can be a constant value or a string value.
expression2 A Variant value or expression associated with the second part of the conditional format when the operator argument is acBetween or acNotBetween (otherwise, this argument is ignored). Can be a constant value or a string value.

Remarks

You can use the Delete method of the FormatConditions collection to delete an existing FormatConditions collection from a combo box or text box control.