ACC: How to Create a "Please Wait" Message

Last reviewed: October 24, 1997
Article ID: Q96989
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SUMMARY

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

Sometimes you may want to display a status message to inform a user he or she must wait for an action to be completed. For example, you may want to display the text "Please Wait" while Microsoft Access is initializing a database, running a long query, and so on. You can do this by using a form and a macro. This article presents a simple example using the sample database Northwind.mdb (or NWIND.MDB in version 1.x or 2.0).

NOTE: This article explains a technique demonstrated in the sample files, FrmSampl.exe (for Microsoft Access for Windows 95 version 7.0) and FrmSmp97.exe (for Microsoft Access 97). For information about how to obtain these sample files, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q150895
   TITLE     : ACC95: Microsoft Access Sample Forms Available on MSL

   ARTICLE-ID: Q175066
   TITLE     : ACC97: Microsoft Access 97 Sample Forms Available on MSL

MORE INFORMATION

To display a status message in Microsoft Access, do the following:

  1. Create a new form not based on any table or query, and name it PLEASEWAIT. Add a label with the message you want to display. For example, type "Please Wait" (without the quotation marks) as the caption. The form properties should be set to the following:

          Form: PLEASEWAIT
          ----------------
          ScrollBars: Neither
          Popup: Yes
          Modal: Yes
          RecordSelectors: No
          NavigationButtons: No
    

  2. Create the following macro named Test1:

          Macro Name             Action
          -----------------------------
          Test1                  OpenForm
                                 RepaintObject
                                 OpenQuery
                                 Close
    
          Test1 Actions
          -----------------------------
          OpenForm
             Form Name: PLEASEWAIT
             View: Form
             Data Mode: Read Only
             Window Mode: Normal
          RepaintObject
             Object Type: Form
             Object Name: PLEASEWAIT
          OpenQuery
             Query Name: Order Details Extended
             View: Datasheet
          Close
             Object Type: Form
             Object Name: PLEASEWAIT
             Save: No     (Microsoft Access 7.0 and 97)
    
       NOTE: The above argument for OpenQuery is just an example of what you
       may want to run; this can be anything. The main macro actions in Test1
       are OpenForm, RepaintObject, and Close.
    
    

  3. Run the macro. The PLEASEWAIT form should open. As soon as the query completes processing, the form disappears and the query results appear.


Additional query words: statusbar status bar meter wait
Keywords : FmsOthr kbusage
Version : 1.0 1.1 2.0 7.0 97
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: October 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.