SortAscending Method

Microsoft Office Web Components Visual Basic

expression.SortAscending

expression    Required. An expression that returns a DataPage object.

Remarks

This method relies upon the current selection on the data access page to determine the field to sort by. Therefore, you must set the focus to the field to sort by, when the procedure containing this method is invoked by a control on the data access page, such as a command button.

Example

This example sorts the ProductName field in ascending order.

Sub SortProductNameAscending()

   ' Set focus to the control for the ProductName field.
   MSODSC.Datapages(0).FirstSection.HTMLContainer.Children("ProductName").Focus

   ' Sort the field in descending order.
   MSODSC.DataPages(0).SortAscending

End Sub