ACC2000: PreviousSection Property Causes Microsoft Access and Internet Explorer to Quit Unexpectedly (223248)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q223248
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

Microsoft Access or Microsoft Internet Explorer unexpectedly quits when you browse to a data access page that tries to reference the PreviousSection property.

RESOLUTION

Avoid using programming code that references the PreviousSection property.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This problem only occurs when you try to access the PreviousSection property on a grouped or banded data access page, but only when the group contains no matching records. If the group you are viewing contains one or more matching records, the PreviousSection property can be successfully accessed.

Steps to Reproduce the Behavior

  1. Create a new database.
  2. Import the following two tables from the sample database Northwind.mdb:

    Categories
    Products

  3. Create a new query by using the following SQL statement, and then run the query:
    DELETE *, CategoryID FROM Products WHERE CategoryID=8;
    					
  4. Click Yes to deleted the specified records, and then close the query without saving it.
  5. Click Pages in the Database window, and then double-click Create data access page by using wizard.
  6. In the Page Wizard, click Table: Products under Table/Queries, click the >> button to select all fields, and then click Finish.
  7. In Design view of the new data access page, expand Tables, and then expand Categories in the field list.
  8. Drag the CategoryID field and hold it directly above the bar that is labeled Header: Products. After you see a blue line with inward pointing arrows, release the mouse button. This creates a text box in a new section called Header: Categories.
  9. On the View menu, click Sorting and Grouping, and for the Categories group, set Group Footer to Yes.
  10. Close the Sorting and Grouping dialog box, and note the new section called Footer: Categories. Add a command button to this section.
  11. Assign Test to the ID property of this button.
  12. Click the bar labeled NavigationSection: Products, and then press DELETE to remove this section.
  13. Start Microsoft Script Editor, and then in the Script Outline, expand Test, and double-click onclick.
  14. Enter the following script:
    <SCRIPT event=onclick for=Test language=vbscript>
     <!--
      Dim MySection
      Set MySection = MSODSC.CurrentSection
      Set MySection = MySection.PreviousSection
     -->
    </SCRIPT>
    					
  15. Close the Script Editor and when you are prompted to save changes, click Yes, saving the page as Page1.htm.
  16. Switch to Page view and note that there are categories 1 through 8. If you expand any of the first 7 categories, you see the products that match that category, and you can successfully click the button that references the PreviousSection property.

    If you go to category 8, note that the Expand button for category 8 will still switch from Plus to Minus, even though there are no matching products. As long as you have category 8 collapsed, you can click the button and successfully set the MySection variable to the PreviousSection property. But if you expand category 8 and then click the button, Access appears to to stop responding (hang), and will then shut down completely.

Modification Type:MajorLast Reviewed:6/29/2004
Keywords:kbbug kbpending KB223248