Hi Alonso
In the click of the cancel button you only need.
CLEAR EVENTS
Thisform.Release()
All The other code slould be in the prg after the READ EVENTS and you don't need the QUIT.
>Hi, don't know why, but i can't make this work.
>
>I have my login form with 2 buttons, OK and Cancel. If the user clicks on the Cancel button, the app have to finish, but I keep getting the message "Cannot quit Visual FoxPro".
>
>Here is the code placed on the click event of the Cancel button:
>
>
>ON SHUTDOWN
>
>SET SYSMENU TO
>
>CLOSE DATABASES ALL
>
>WAIT CLEAR
>
>RELEASE ALL EXTENDED
>
>CLEAR EVENTS
>
>QUIT
>
>
>please, help.
>
>Alonso
Alexandre Palma
Senior Application Architect