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
- Open any database.
- In the Database window, click Pages under Objects, and then click New.
- In the New Data Access Page dialog box, click Design View, and then click OK.
- Add a command button to the Section: Unbound section of the data access page.
- On the Tools menu, point to Macro, and then click Microsoft Script Editor.
- On the HTML menu, point to Script Block, click Client, and then type the following code:
- On the View menu, point to Other Windows, and then click Script Outline. This places the focus on the Client Objects & Events node.
- 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
- Press ALT+TAB to switch back to Microsoft Access, and then click Page View on the View menu.
- Click the command button. Note that the mouse pointer does not become an hourglass until you move the mouse pointer off the command button.
- 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.