PRB: Min or Max Properties Not Checked Upon Return to Form

    Article ID: Q142230
    Creation Date: 08-JAN-1996
    Revision Date: 01-DEC-1996

    The information in this article applies to:

    • Microsoft Access versions 7.0, 97

    SYMPTOMS

    Moderate: Requires basic macro, coding, and interoperability skills.

    In Microsoft Access 7.0 and 97, when you use a form to open another form while the first form is maximized, the first form does not come back in its maximized state when the second form is closed, unless the second form was also maximized. Microsoft Access version 2.0 checks to see if the first form was maximized, and if so, opens it maximized. In Microsoft Access 7.0 and 97, if the first form is not being closed, it does not check for the Min or Max properties.

    RESOLUTION

    To work around this behavior, close the first form and then, when it is opened, it will be maximized properly. For the steps to accomplish this task, see the "Steps to Work Around Behavior" section later in this article.

    MORE INFORMATION

    Steps to Reproduce Behavior

    1. Open the sample database Northwind.mdb.
    2. Create the following new form:

            Form: Form1
            ----------------------------------------------
            MinMaxButtons: None
            OnOpen: set to the following [Event Procedure]
      

               Private Sub Form_Open ()
                  DoCmd.Maximize
               End Sub
      

            Command button:
            Name: Button0
            OnClick: set to the following [Event Procedure]
      

               Private Sub Button0_Click()
                  DoCmd.OpenForm "form2"
               End Sub
      
    3. Create a second form and save it as Form2.
    4. Open the Form1 form and click the command button.
    5. Close the Form2 form. Note that the Form1 form is no longer maximized.
    6. Close the Form1 form.

    Steps to Work Around Behavior
    1. Open the Form1 form in Design view.
    2. Add the following line of code to the Click event of the Button0 button:

            docmd.close acform, "Form1", acsaveyes
      
    3. Save and close the Form1 form.
    4. Open the Form2 form in Design View
    5. Set the OnClose property of the form to the following [Event Procedure]:

            Private Sub OnClose_Form()
               docmd.openform "Form1"
            End Sub
      
    6. Open the Form1 form and click the command button.
    7. Close the Form2 form. Note that the Form1 form is now maximized.

    REFERENCES

    For more information about the DoCmd object, search the Help Index for "Docmd object," or ask the Microsoft Access 97 Office Assistant.


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.

KBCategory: kbusage
KBSubcategory: FmsProp
Additional reference words: 7.00 97 8.00 gnl sizing window