
Remove the Close command from the system menu
If you want to prevent the user from closing a form by using Alt+F4 or by clicking on the “X” button in the upper-right corner you just need to write some code in the form’s QueryUnload event procedure: Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If UnloadMode = vbFormControlMenu