ACC: Hourglass May Not Change After Illegal Function Call

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

SYMPTOMS

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

You can change the mouse pointer from an arrow to an hourglass with a user- defined function. If you encounter an illegal function or halt the code after setting the pointer to an hourglass, the hourglass does not change back to the arrow pointer. However, you can still open and close items by clicking them.

RESOLUTION

In Microsoft Access for Windows 95 version 7.0

You can type "DoCmd.Hourglass False" (without the quotation marks) in the Debug window to get the pointer back.

In Microsoft Access versions 1.x and 2.0

You can type "DoCmd Hourglass false" (without the quotation marks) in the Immediate window to get the pointer back.

STATUS

This behavior is by design. Visual Basic for applications (or Access Basic in versions 1.x and 2.0) will never reset Echo, Warnings, or Hourglass when run from Visual Basic or Access Basic. These are only reset when the last script runs.

MORE INFORMATION

Because an illegal function call stopped the execution of the function before the command to reset the mouse pointer from an hourglass to an arrow could run, the mouse pointer remains in the hourglass state.

Steps to Reproduce Behavior

  1. Create a blank form.

  2. Add a command button to the form, and set the OnClick property to the following event procedure:

          Dim x as Double
          DoCmd.Hourglass True 'In version 7.0 only.
          DoCmd Hourglass True 'In versions 1.x and 2.0 only.
          x = 1/0
          Docmd.Hourglass False 'In version 7.0 only.
          DoCmd Hourglass False 'In versions 1.x and 2.0 only.
    

  3. View the form in Form view and click the command button. Note that you receive an error message because of the division by zero. When you click End on the error message, your pointer is still the hourglass. Press Ctrl+G (or click Immediate window on the View menu in versions 1.x and 2.0) and type "DoCmd.Hourglass False" (or "DoCmd Hourglass False" in versions 1.x and 2.0) without the quotation marks to restore the pointer.
Keywords          : kbprg PgmOthr SynGnrl
Version           : 1.0 1.1 2.0 7.0
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb
Solution Type     : kbworkaround


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


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 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.