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

Last reviewed: August 6, 1997
Article ID: Q89597
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0

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:

  1. 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 "User" ()
          Declare Function ShowWindow% Lib "User" (ByVal hWnd%,_
    
                                                   ByVal nCmdShow%)
    
    

  2. Create the function MaximizeAccess():

          Function MaximizeAccess ()
    
             Dim ActiveWnd%, Maxit%
             ActiveWnd% = GetActiveWindow()
             Maxit% = ShowWindow(ActiveWnd%, 3)
          End Function
    
    

  3. Create the function MinimizeAccess():

          Function MinimizeAccess ()
    
             Dim ActiveWnd%, Minit%
             ActiveWnd% = GetActiveWindow()
             Minit% = ShowWindow(ActiveWnd%,2)
          End Function
    
    

  4. Create the function RestoreAccess():

          Function RestoreAccess ()
    
             Dim ActiveWnd%, Restoreit%
             ActiveWnd% = GetActiveWindow()
             Restoreit% = ShowWindow(ActiveWnd%, 1)
          End Function
    
    

  5. The following sample macro action minimizes the Microsoft Access window:

          Action       FunctionName
          -----------------------------
          RunCode      MinimizeAccess()
    
    

REFERENCES

For an example of how to maximize, minimize, and restore Microsoft Access in Microsoft Access for Windows 95 version 7.0 and Microsoft Access 97, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q148834
   TITLE:      ACC: How to Minimize, Maximize, and Restore MS Access 95/97

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for Windows 3," Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to Programming Reference" Volumes 1-6, Microsoft Press, 1992

Keywords          : kbprg PgmApi
Version           : 1.0 1.1 2.0
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.