Disabling Access 97 application close button 
Author Message
 Disabling Access 97 application close button

I am trying to disable the Access 97 application close button, or link it to an
event to force poeple to exit the application via a menu option. I need to ensure
certain items are written to one of my tables before the application is closed.
Does anyone know how to do this?

Regards

Derek



Mon, 03 Mar 2003 03:00:00 GMT  
 Disabling Access 97 application close button
It's a sneaky trick; open a hidden form before all others.  In the forms
Unload event do something like this:

    ' A close was started - need to wait until menu says its OK to close.
    If Not (fDebug) Then
      If Not (Me![cbxOKtoclose]) Then
        gstrMBTitle = "Close error."
        gstrMBMsg = "You cannot close the application by closing the Access
window."
        gstrMBMsg = gstrMBMsg & Chr$(13) & Chr$(10) & Chr$(13) & Chr$(10) &
"Please close the application normally to exit."
        gintMBDef = MB_OK + MB_ICONSTOP
        gintMBBeep = True
        gintMBLog = False
        Call DisplayMsgBox
        Cancel = True
      End If
    End If

Since the form was opened first, Access tries to close it first.  By
checking a flag (a variable or a control), you can see if it's OK to close
or not.  If not cancel the event.  Here I use a check box on the form which
I set from my menu when a user pushes the "EXIT" button.

Jim.



Tue, 04 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Disable Access Close Button not Form Close Button?

2. Disabling the close button on the Access application window

3. Disable the close button for Access Application

4. disable application close button

5. Can you disable the application close button?

6. Disabling Application Close (X) Button

7. Disable Application Close Button

8. Disable Close button on Application Window

9. Disable close button in excel 97

10. Access Application Disable, Restore & Close


 
Powered by phpBB® Forum Software © phpBB Group