Disabling the 'X' controlo on forms

illy2k

Registered User.
Local time
Today, 16:40
Joined
Apr 21, 2003
Messages
51
I have seen code on how to disable the 'X' close button on the actual Access Program, but I have no been able to figure out how to stop someone from closing a form with the 'X' close button. Any ideas, or can anyone point me in the direction of a post that answerts this question.
 
Like this:

Code:
Option Explicit
Option Compare Database

Dim booFormLock As Boolean


Private Sub Form_Unload(Cancel As Integer)
    If Not booFormLock Then Cancel = True
End Sub

Private Sub cmdCloseForm_Click()
    booFormLock = True
    DoCmd.Close acForm, Me.Name
End Sub
 

Users who are viewing this thread

Back
Top Bottom