The root object of the form stores the return value from its Unload event with the TO clause of the DO FORM command.
Make sure the root object is a form or a form set.