I have a form that is central to my database. Don't want to allow any way to close it (thus stopping accidental closures) except when a user clicks on a close database button.
I have the following code in the form unload which works fine.
Private Sub Form_Unload(Cancel As Integer)
If mblnCancel = False Then Cancel = -1
End Sub
However I can't close the database with this code in place. Can anyone help with the way I can have a button which would allow the database to close either still leaving the unload code in place or turning it to true to close the database.
Or any way to do this in a easier manner?
I have the following code in the form unload which works fine.
Private Sub Form_Unload(Cancel As Integer)
If mblnCancel = False Then Cancel = -1
End Sub
However I can't close the database with this code in place. Can anyone help with the way I can have a button which would allow the database to close either still leaving the unload code in place or turning it to true to close the database.
Or any way to do this in a easier manner?