ACC: How to Hide the Database Window When MS Access Starts

Last reviewed: April 2, 1997
Article ID: Q88160
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.

When you start Microsoft Access, the Database window is usually visible. If you do not want a user to be able to gain access to the Database window, you can create an AutoExec macro that hides the Database window. This article describes how to create the macro to do this.

MORE INFORMATION

When a Microsoft Access database is first loaded, Microsoft Access checks for an AutoExec macro and runs it if it exists. The following macro will hide the Database window from the user:

  1. From the File menu, choose New to create a new database. Give the database a unique name.

  2. From the File menu, choose New, and then choose Macro to create a new macro.

  3. Add the following actions:

          Action              Comment
          ------------------------------------------------------------------
          SelectObject        Select an object in the Database window so the
                              focus is set to the Database window.
          DoMenuItem          Hide the object that has the current focus.
    
    

  4. Set the following properties for the actions entered above:

          SelectObject Action
          -----------------------
          Object Type: Macro
          Object Name: AutoExec
          In Database Window: Yes
    

          DoMenuItem Action
          -----------------
          Menu Bar: Form
          Menu Name: Window
          Command: Hide
    

  5. From the File menu, choose Save As, and save the macro as AutoExec.

  6. Close and reopen the database.

The macro will hide the Database window. However, menu items still exist to show the Database window. To hide these items, you can create a custom menu for your application, or use one of the following techniques depending on your version of Microsoft Access:
  • Version 1.x: Disable the Show command on the File menu.
  • Version 2.0: Disable the UnHide command on the Window menu.

REFERENCES

For more information about custom menus, search for "customizing menus" using the Microsoft Access Help menu.


Additional query words: gray grey dimmed container
Keywords : kbusage McrActn
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: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.