ACC95: Form Size Shrinks Changing from Design View to Form View

ID: Q148853


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


SYMPTOMS

When you toggle a form back and forth from Design view to Form view, the form shrinks in size.


CAUSE

The form has its ScrollBars property set to Neither and one or more of the following properties set as follows:


   BorderStyle: (set to anything but "Sizable")

   -or-

   ControlBox: No

   -or-

   Min Max Buttons: (set to anything but "Both Enabled") 


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 7.0. This problem no longer occurs in Microsoft Access 97.


MORE INFORMATION

Steps to Reproduce Problem


  1. Open the sample database Northwind.mdb and open the Customers form in Design view.


  2. Set the form's ScrollBars property to Neither.


  3. Set one or more of the following properties:
    
          BorderStyle: (set to anything but "Sizable")
    
          -or-
    
          ControlBox: No
    
          -or-
    
          Min Max Buttons: (set to anything but "Both Enabled") 


  4. Click the Form View button on the toolbar to view the form in Form view.


  5. Click the Form View button on the toolbar to change back to Design view.


  6. Repeat steps 4-5 a number of times. Note that the form's width shrinks in size each time you toggle the form.



RESOLUTION

Create the following subroutine procedure in a global module


   Sub SizeToFitForm()
      ' Invoke the Window | Size to Fit Form menu command
      DoCmd.DoMenuItem 0, 7, 6, 0, acMenuVer70
   End Sub 

and call it in the Open event of the form as follows:

   Private Sub Form_Open(Cancel As Integer)
      SizeToFitForm
   End Sub 

Additional query words: scroll bar bars shrink shrinking

Keywords : kbusage FmsProp
Version : 7.0
Platform : WINDOWS
Issue type : kbbug


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