ACC97: Unable to Quit Microsoft Access

ID: Q190074


The information in this article applies to:
  • Microsoft Access 97


SYMPTOMS

When you try to quit Microsoft Access version 97, you find that you are able to close the database, but you are unable to quit Microsoft Access. Instead, Microsoft Access is minimized without generating any errors.


CAUSE

You have code behind a subform control that references a Boolean control such as a check box on the main form, and are using an If..Then statement to implicitly test for a value of True, as shown in the following example:


   If Me.Parent![CheckBox] Then

       MsgBox "true"

   End If 


RESOLUTION

This problem can be resolved by modifying the code to explicitly compare the control on the main form with a value such as True or False. Using the example from the "Cause" section, the resolution would appear as follows:


   If Me.Parent![CheckBox] = True Then

      MsgBox "true"

   End If 


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97


MORE INFORMATION


Steps to Reproduce Problem


  1. Start Microsoft Access, and create a new database.


  2. Create a new form not based on any table or query in Design view and save it as frmMain:
    
            Form: frmMain
            ----------------
            Caption: frmMain
    
            Check box:
               Name: Check0 


  3. Set the OnLoad property of the form to the following event procedure:
    
            Private Sub Form_Load()
               Check0 = False
            End Sub 


  4. Create a new form not based on any table or query in Design view and save it as frmSub:
    
            Form: frmSub
            ----------------------------------
            Caption: frmSub
    
            Text box:
               Name: Text1
               After Update: [Event Procedure] 


  5. Set the AfterUpdate property of the Text1 text box to the following event procedure:
    
            Private Sub Text1_AfterUpdate()
               If Me.Parent!Check0 Then
                  MsgBox "Checked - Now Try to close Access"
               End If
            End Sub 


  6. Close and save the frmSub form.


  7. Drag the frmSub form from the Database window to the bottom of the frmMain form created in Step 2 to create a subform control.


  8. Select the new subform control and set the following properties:
    
            Name: frmSub
            SourceObject: frmSub 


  9. View the form in Form view.


  10. Type testing in the text box contained within the subform control, and press TAB.


  11. Close the frmMain form.


Note that when you try to quit Microsoft Access, Microsoft Access does not close. Instead, Microsoft Access is minimized without generating any errors.

Additional query words: can't minimize unable

Keywords : kbdta
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: April 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.