Microsoft KB Archive/190074

= ACC97: Unable to Quit Microsoft Access =

Article ID: 190074

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q190074





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



Steps to Reproduce Problem
 Start Microsoft Access, and create a new database.  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   Set the OnLoad property of the form to the following event procedure:

Private Sub Form_Load Check0 = False End Sub </li>  Create a new form not based on any table or query in Design view and save it as frmSub:

<pre class="fixed_text">       Form: frmSub --       Caption: frmSub

Text box: Name: Text1 After Update: [Event Procedure] </li>  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 </li> Close and save the frmSub form.</li> Drag the frmSub form from the Database window to the bottom of the frmMain form created in Step 2 to create a subform control.</li>  Select the new subform control and set the following properties:

<pre class="fixed_text">       Name: frmSub SourceObject: frmSub </li> View the form in Form view.</li> Type testing in the text box contained within the subform control, and press TAB.</li> Close the frmMain form.</li></ol>

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

<div class="references_section">