Sets or gets the name of the macro or script to be run when the Open event is triggered.
object.OnOpen = [string]
Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the script or macro to run when the Open event is triggered.
Newlook Smartclient
Newlook Server
The Open event occurs every time an Added form is loaded via the OpenForm macro action or script method. Typically this property is used to include global or specific form initialization. For example it may be used with a script that specifies default settings for controls, indicates content to be loaded into a combo box or list box control and/or initializes variables used in the form.
When you create macros or scripts for related events, such as Activate and GotFocus, be sure that their actions don't conflict and that they don't cause recursive events.
If you wish to run the same macro or script every time an Added form loads then assign a macro/script to the OnOpen property of the App object in your Startup macro.
The following line in the Startup macro will cause the macro titled "AddedFormInitialization" to run every time an Added form is opened :
SetValue App.OnOpen "AddedFormInitialization"
If you wish to run a specific macro or script for an individual Added form/s then assign a macro/script to the OnOpen property of the Form object of your chosen form.
When a macro or script is assigned to both the App object and the Form object then the macro/script assigned to the OnOpen property of the form will run before the macro assigned to the App object.
© 2004-2021 looksoftware. All rights reserved.