Use the CLOSEWINDOW command to close a form from within an application or entry/exit procedure. Without the alias it closes the current form.
Options
alias
Specifies a window name, which is the name given to the instance of a form started with the MDI option when using the AS alias option with the EDIT USING or ENTER command.