Subscribe method

Applies to

Description

When you use plug-in technology, use Subscribe to tell FORMS which events you want to subscribe to (use). Your plug-in is called every time the EventName event is fired, i.e. on application level. If you only are interested in events on a certain form or field (not on all forms or fields), use the SubscribeToObject method.

Syntax

[ReturnValue =] Object.Subscribe(Handler, EventName, HandlerFunction)

Settings

Part

Data type

Description

Object

Object

An object expression that evaluates to one of these objects.

Handler

Object

A handle to your plug-in module.

EventName

String

The name of the event, for example FormComplete.

HandlerFunction

String

The name of the function in your plug-in that will execute when the EventName event is fired.

Return value

Data type: Long. -1 is returned when the method fails, for example when the EventName is misspelled.

Example of use

'** Subscribe to interesting events

call Application.Subscribe( Me, "FormComplete", "OnFormComplete")

Remarks

If two or more plug-ins subscribe to the same event, see Calling conventions.

Classic method

Subscribe