COLID keyword

Applies To

Event handlers.

Description

Limits the execution of an event handler to events fired in a specified collection.

Syntax

COLID( CollectionIdentifier )

Part Description
CollectionIdentifier Expression that evaluates to a string that identifies a collection. CollectionIdentifier can be any of the following:

object: The primary collection.

object.PropertyName: A subcollection of the primary collection, where PropertyName is a property name that identifies the subcollection.

objectn: A secondary collection.

objectn.PropertyName: A subcollection of a secondary collection, where PropertyName is a property name that identifies the subcollection.

*: All collections. The same as no COLID specification; the event handler is executed for all collections. COLID( ) is equivalent to COLID( * ).

Remarks

By default, a handler for an event executes whenever the event fires in the current collection on a form. The COLID keyword allows you to restrict execution of an event handler to events fired in a specific collection.

The effect of the COLID keyword with StdObject-type events, such as StdObjectDelete and StdObjectRefresh, is different from the effect with all other types of events. For events of the StdObject type, the COLID keyword restricts execution of an event handler to the specified collection but the collection does not have to be current when the event fires. For example, if you create an event handler for the StdObjectRefresh event, and specify COLID(object), then the event handler executes whenever the primary collection performs a refresh, even if the primary collection is not the current collection (this can occur if the form programmatically causes a refresh).

For all other types of events, including StdForm-type events, such as StdFormDelete and StdFormRefresh, the specified collection must be current when the event fires. For example, if you create an event handler for the StdFormLoadBoundValues event, and specify COLID(object), then the event handler will be run only if the primary collection is the current collection when the event is generated.

Example

In these event handler parameters, the COLID keyword restricts execution of the event handler to a subcollection event.
object.OpFeedbackViews COLID(object.OperationDetails)