SetRestriction

The SetRestriction method sets a restriction on a table.

Applies To

All Table objects

Syntax

objAppointmentsTable.SetRestriction Property, BoundaryValue, Comparison

Parameters

Property
Specifies the name or identifier of the property to which the restriction applies.
BoundaryValue
Specifies the value of the restriction.
Comparison
Specifies one or more characters that indicate the comparison to be evaluated against the BoundaryValue parameter.

Remarks

The SetRestriction method can be used only on tables that do not contain a merged list of single and recurring items. For example, this method can be invoked on the SingleAppointments and RecurringAppointments tables, but not on the Appointments table.

This method restricts the rows of the table to those meeting the specified criteria. For example, if Property is CityBusiness, BoundaryValue is Boston, and Comparison is ==, the available rows of the table will be contacts based in Boston, as shown in the following sample code:

objContactsTable.SetRestriction "CityBusiness", "Boston", "=="

If no parameters are specified, all previous restrictions are removed.

The Comparison parameter can have the following values.

Value Description
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to

See Also

SetRange