Microsoft KB Archive/116386

= ADT/ODE: Minimizing All Objects Sets Focus to Database Window =

Article ID: 116386

Article Last Modified on 11/14/2003

-

APPLIES TO


 * Microsoft Access Developer's Toolkit 2.0
 * Microsoft Access Developer's Toolkit 1.1
 * Microsoft Office 97 Developer Edition

-



This article was previously published under Q116386



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



SYMPTOMS
When all the objects in an application that is running in the run-time version of Microsoft Access are minimized, focus is passed to the Database window even though the Database window is not visible.

If you press a key or key combination that is a valid command in the Database window while all the objects in the application are minimized, the Database window command corresponding to the key or key combination will be carried out. Examples of a key or a key combination that are valid commands in the Database window include ENTER, which opens or runs the currently selected object, and ALT+N, which creates a new object.



RESOLUTION
Include a form in the application that cannot be minimized.



MORE INFORMATION
Many Microsoft Access applications include a Main Menu or Main Switchboard form that is automatically opened with the AutoExec macro and stays open the entire time that the application is open. This form is a good choice for a form that cannot be minimized.

The following form property settings will prevent the form from being minimized:   Property        Setting -  Min Max Buttons   No  (Microsoft Access 97 and 7.0 property only) Min Button       No  (Version 2.0 property only) Control Box      No

Steps to Reproduce Behavior
 Open the sample database Northwind.mdb (or NWIND.MDB in version 2.0). In Microsoft Access 97 and 7.0:

 On the Tools menu, click Startup. In the Startup dialog box, under Display Form, select Main Switchboard as the startup form.

In Microsoft Access 2.0:

Create a new macro with the following action, and then save the macro as AutoExec: <pre class="fixed_text">           Action: OpenForm FormName: Main Switchboard

</li> Quit Microsoft Access.</li> On the Start Menu click Run. (Or in Windows 3.x, in Program Manager, choose Run from the File menu.)</li>  In the Open box (or Command Line box in Windows 3.x), type the following line, and then press ENTER.

NOTE: In the following command, an underscore (_) at the end of a line is used as a line-continuation character. Remove the underscore from the end of the line when re-creating this command.

In Microsoft Access 97: "C:\Program Files\Microsoft Office\Office\Msaccess.exe _     C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb_      /Runtime" In Microsoft Access version 7.0: C:\MSOffice\Access\Msaccess.exe _ C:\MSOffice\Access\Samples\Northwind.mdb /Runtime In Microsoft Access version 2.0: C:\ACCESS\MSARN200.EXE C:\ACCESS\SAMPAPPS\NWIND.MDB _ /INI C:\WINDOWS\MSACC20.INI </li> After Microsoft Access starts and the Main Switchboard form opens, minimize the Main Switchboard form.</li> Press ENTER or ALT+N. Note that because these are valid commands in the Database window, the Database window command is carried out.</li></ol>

Keywords: kbui kbprb KB116386

-

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

© Microsoft Corporation. All rights reserved.