ACC2000: Sort Order Lost When You Edit Records in a Microsoft Access Project (257532)
The information in this article applies to:
This article was previously published under Q257532 This article applies only to a Microsoft Access project (.adp).
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
In a Microsoft Access project, if you use the Sort Ascending or Sort Descending commands to sort a table by one or more of its fields, any attempt to edit the sorted field causes the sort order to be lost.
RESOLUTION
In the Microsoft Access project, create a stored procedure that sorts the
data and then displays the data in the correct order. The following steps use the Employees table in NorthwindCS.adp to show you an example of how to do this.
- CAUTION: If you follow the steps in this example, you modify the sample Access project NorthwindCS.adp. You may want to back up the NorthwindCS.adp file and follow these steps on a copy of the project.
- Open the sample project NorthwindCS.adp.
- Click Stored Procedures under Objects.
- Click New, and then type the following script into the new stored procedure:
Create Procedure "SortLastName"
As
SELECT * FROM Employees ORDER BY LastName
return
- Close the stored procedure, click Yes to save the changes, and then save the new stored procedure with the default name of SortLastName.
- Double-click SortLastName to open a recordset based on the Employees table in Datasheet view.
- Change the last name Fuller to Fullerton.
Note that you are able to edit the LastName field without losing the sort order.
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: | 6/29/2004 |
---|
Keywords: | kbbug KbClientServer kbpending KB257532 |
---|
|