Define the Reference

The main form defines a reference to the child form (in this example called #REFEX2):


DEFINE_COM class(#REFEX2) name(#AddressForm) reference(*dynamic)

When you use REFERENCE(*DYNAMIC) you tell the application that an instance of the form #REFEX2, referred to as #AddressForm, will be created when you get round to it, not when the main form is loaded (as is the case normally with a DEFINE_COM statement). This means that before you can use this new reference, you have to create it using a SET_REF command.