Microsoft KB Archive/89597

= ACC: How to Minimize, Maximize, and Restore MS Access (1.x/2.0) =

Article ID: 89597

Article Last Modified on 5/9/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q89597



SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.

To maximize, minimize, and restore Microsoft Access, you can use Microsoft Windows application programming interface (API) calls in Microsoft Access modules. Microsoft Access does not provide a function to perform these actions in a module or macro.



MORE INFORMATION
Once you define the following sample functions in a module, you can use them in macros as RunCode actions. To define the functions, follow these steps:

  From the File menu, choose New, and then Module. In the Declarations section add both of the following declarations:

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

Option Explicit Declare Function GetActiveWindow% Lib &quot;User&quot; Declare Function ShowWindow% Lib &quot;User&quot; (ByVal hWnd%,_                                              ByVal nCmdShow%)   Create the function MaximizeAccess:

Function MaximizeAccess Dim ActiveWnd%, Maxit% ActiveWnd% = GetActiveWindow Maxit% = ShowWindow(ActiveWnd%, 3) End Function   Create the function MinimizeAccess:

Function MinimizeAccess Dim ActiveWnd%, Minit% ActiveWnd% = GetActiveWindow Minit% = ShowWindow(ActiveWnd%,2) End Function   Create the function RestoreAccess:

Function RestoreAccess Dim ActiveWnd%, Restoreit% ActiveWnd% = GetActiveWindow Restoreit% = ShowWindow(ActiveWnd%, 1) End Function   The following sample macro action minimizes the Microsoft Access window:

     Action       FunctionName -     RunCode      MinimizeAccess 

<div class="references_section">