Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Mouse Pointer Does Not Change Its Appearance When You Set It Programmatically in a Data Access Page


View products that this article applies to.

This article was previously published under Q203165
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

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

↑ Back to the top


Symptoms

When you use script in a data access page to change the appearance of a mouse pointer, the mouse pointer does not change its appearance until you physically move the mouse.

↑ Back to the top


More information

Developers often change the appearance of a mouse pointer programmatically to inform a user that some action needs to be taken. For example, changing the mouse pointer to an hourglass informs the user to wait until some process has completed before the user can continue.

In data access pages, however, if the developer uses script to change the appearance of the mouse pointer, the mouse pointer will not change its appearance until the user moves the mouse.

Steps to Reproduce the Behavior

  1. Open any database.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. Add a command button to the Section: Unbound section of the data access page.
  5. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  6. On the HTML menu, point to Script Block, click Client, and then type the following code:
    Dim blnVar
    					
  7. On the View menu, point to Other Windows, and then click Script Outline. This places the focus on the Client Objects & Events node.
  8. Expand the Command0 node, and then double-click the onclick node. This moves the mouse pointer to the onclick event script for Command0. Type the following script:
    If blnVar Then
        document.body.style.cursor = "default"
    Else
        document.body.style.cursor = "wait"
    End If
    
    blnVar = Not blnVar
    					
  9. Press ALT+TAB to switch back to Microsoft Access, and then click Page View on the View menu.
  10. Click the command button. Note that the mouse pointer does not become an hourglass until you move the mouse pointer off the command button.
  11. Without using the mouse, press ENTER to trigger the command button. Note that the hourglass does not return to an arrow until you move the mouse. You can test this behavior repeatedly by pressing ENTER, and then moving the mouse.

↑ Back to the top


Keywords: KB203165, kbdap, kbbug

↑ Back to the top

Article Info
Article ID : 203165
Revision : 4
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 209