Microsoft Knowledge Base Email Alertz

(225891) - When you click Quick View in the Microsoft Script Editor to view a data access page, the onbeforeunload window event is not executed.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 225891 - Last Review: June 29, 2004 - Revision: 2.0

ACC2000: Microsoft Script Editor Does Not Execute the OnBeforeUnload Window Event Procedure

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

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

SYMPTOMS

When you click Quick View in the Microsoft Script Editor to view a data access page, the onbeforeunload window event is not executed.

RESOLUTION

After you save the data access page:
  • Click View In Browser on the View menu in the Microsoft Script Editor.
  • Click Page View on the View menu in Microsoft Access.
  • Load the page directly in Microsoft Internet Explorer 5 or later.

MORE INFORMATION

If you view a data access page in Microsoft Access, both the onbeforeunload and the onunload window events are executed. If you view the data access page directly in Internet Explorer 5 or later, both events are also executed. But if you click Quick View in the Microsoft Script Editor, only the onunload event is executed; the onbeforeunload event is not executed.

Steps to Reproduce the Behavior

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, click the View Products page, and then click Design View.
  3. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  4. On the View menu in the Microsoft Script Editor, point to Other Windows, and then click Script Outline.
  5. In the Script Outline window, scroll down and expand the window node.
  6. Double-click onbeforeunload, and then type the following script:
    MsgBox "On Before Unload"
    					
  7. Double-click onunload, and then type the following script:
    MsgBox "On Unload"
    					
  8. Click the Quick View tab at the bottom of the Microsoft Script Editor.
  9. Click the Source tab at the bottom of the Microsoft Script Editor.
Note that only the message box in the onunload window event is executed. The message box in the onbeforeunload window event is not executed.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbbug kbdap kbpending kbdapscript KB225891
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate