ACC2002: Access Crashes When You Sort a Table That Has a Subdatasheet (295251)
The information in this article applies to:
This article was previously published under Q295251 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
When you apply a sort to a table, a view, a stored procedure, or a function in a Microsoft Access project (.adp) file, you receive the following error message, and then Microsoft Access crashes.
Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience.
When you view the details of the error report, you see that the error occurred in Msaccess.exe.
CAUSE
This behavior occurs when all of the following conditions are true: - The object contains a subdatasheet that has been expanded at least once.
- You used the Sort Ascending or Sort Descending commands on the menu or toolbar to sort the object.
- The object returns approximately 700 records or more. The actual number of records may vary in different tables.
RESOLUTION
There are several possible workarounds for this problem.
Apply Sorting in Design View of a View, a Stored Procedure, or a Function
One workaround to the problem is to not use the Sort Ascending or Sort Descending commands on the menu or toolbar. Instead, create a view, a stored procedure, or a function, and then apply the sort by using the Sort Type column in the graphical designer. If you are using the text designer to create a function or a stored procedure, add the ORDER BY clause to your SQL statement to apply the sorting.
Restrict the Resultset Returned by the Object
A second workaround is to use criteria in a view, a stored procedure, or a function to restrict the number of records returned by the object. Because the actual number of records may vary in different situations, you have to experiment to find the number of records where the problem occurs, and then restrict the resultset to return fewer records.
Use a Linked Subform Instead of a Subdatasheet
A third workaround is to use a subform instead of a subdatasheet. You can create a main form that is based on the main table or query that contained the subdatasheet and a subform that is based on the table or query being used as the subdatasheet. Then, you can link the subform to the main form by setting the LinkChildFields and LinkMasterFields properties in Design view.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kbbug kberrmsg kbnofix KB295251 |
---|
|