Is there a way to recover from a user pressing the 'close' button.. ie the top right X button, to unload a form or exit a program?? I can use the form.unload to trap the event but can't seem to stop the event happening anyway. Any clues?
30-05-2002 at 06:36 AM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1617
Re: Stopping a form unload. Archived to Disk
Although the following will make it so not even you can unload the form with code, so you'll have to modifiy it to unload if done via code (if...then...endif).
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = 1
End Sub