Microsoft KB Archive/119474

= ACC: AutoCenter and AutoResize Properties Ignored =

Article ID: 119474

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q119474



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
If you start Microsoft Access minimized and automatically load a database that contains an AutoExec macro that opens a form that has its AutoCenter or AutoResize property (or both properties) set to Yes, the form's size and location may be incorrect.



RESOLUTION
Set the form's AutoCenter and AutoResize properties to No and manually size and position the form.

-or-

Use a MoveSize action in your AutoExec macro to position the form correctly.



Steps to Reproduce Behavior
Using Windows 95 or later with Microsoft Access 7.0 and 97:

CAUTION: Following the steps in this example will modify the sample database NorthWind.mdb. You may want to back up the NorthWind.mdb file, or perform these steps on a copy of the NorthWind.mdb database.

 Click the Start button, point to Find, and then click Files or Folders. In the Named box, type msaccess.exe, and then click Find Now. Drag the Msaccess.exe file to your Desktop to create a new shortcut called "Shortcut to Msaccess.exe." Using the right mouse button, click the MSaccess.exe shortcut, and then click Properties on the menu that appears. Click the Shortcut tab.  Type a space, and then the full path to the Northwind database in the Target box after Msaccess.exe as in the example below:

       C:\Access7\Msaccess.exe C:\Access7\Samples\Northwind.mdb </li> Click Minimized in the Run box, and then click OK.</li> Double-click the new shortcut. Note that Microsoft Access opens minimized. Restore Microsoft Access from the task bar.</li> Click Startup on the Tools menu, and select the Categories form in the Display Form box. Click OK.</li> Quit Microsoft Access.</li> Double-click the "Shortcut to Msaccess.exe" again, and then maximize the Microsoft Access toolbar icon. Note that the Categories form is not the correct size and is not in the correct location.</li></ol>

Using Windows 3.x or Windows for Workgroups with Microsoft Access 2.0:

CAUTION: Following the steps in this example will modify the sample database NWIND.MDB. You may want to back up the NWIND.MDB file, or perform these steps on a copy of the NWIND database.

<ol> In Windows Program Manager, select the Microsoft Access Icon and then choose Properties from the File menu.</li> In the Command Line box, add a space and then NWIND.MDB to the end of the line.</li> Select the Run Minimized check box and then choose OK.</li> Start Microsoft Access.</li>  Maximize the Microsoft Access icon, and then create and save the following new macro in the sample database NWIND.MDB:

<pre class="fixed_text">     AutoExec Macro Action: OpenForm Form Name: Categories </li> Open the Categories form in Design view.</li> Set the Categories form's AutoCenter and AutoResize properties to Yes and then save the form.</li> Quit Microsoft Access.</li> Start Microsoft Access again and then maximize the Microsoft Access icon. Note that the Categories form is not the correct size, and is not in the correct location.</li></ol>

<div class="references_section">