Microsoft KB Archive/148853

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

Article ID: 148853

Article Last Modified on 11/17/2000

-

APPLIES TO


 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q148853





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.



Steps to Reproduce Problem
 Open the sample database Northwind.mdb and open the Customers form in Design view. Set the form's ScrollBars property to Neither.  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")  Click the Form View button on the toolbar to view the form in Form view.</li> Click the Form View button on the toolbar to change back to Design view.</li> Repeat steps 4-5 a number of times. Note that the form's width shrinks in size each time you toggle the form.</li></ol>

<div class="resolution_section">

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: kbbug kbfix kbusage KB148853

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.