Re: Sort table, not with SQL!



I found a solution to sorting a table!

1) Create a query that will sort the table as needed.
SELECT * FROM tbl_MyTable ORDER BY tbl_MyTable.ValBeginningDate;

I saved this as _qsrt_MySort

2) Put this code in behind your button:
===== Start Code =====

Dim str_Table As String

str_Table = "tbl_MyTable"

Application.Echo False

DoCmd.OpenTable str_Table
DoCmd.ApplyFilter "_qsrt_MySort"
DoCmd.Save acTable, str_Table
DoCmd.Close acTable, str_Table

Application.Echo True

===== End Code =====

This work on repeated attempts.

I hope that this will help someone in the future.

- Daron

.



Relevant Pages

  • Re: Strategy for Sorting in UI
    ... You have to do your sort in the database query using a unique value. ... So, for example, if you are sorting by "LastName" ... > How do I navigate pages in this situation? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Strategy for Sorting in UI
    ... You have to do your sort in the database query using a unique value. ... So, for example, if you are sorting by "LastName" ... > How do I navigate pages in this situation? ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Strategy for Sorting in UI
    ... You have to do your sort in the database query using a unique value. ... So, for example, if you are sorting by "LastName" ... > How do I navigate pages in this situation? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: sorting
    ... When I sort the data using SQL, ... But this is just the sorting. ... If it were me I would query the database and bring back the ...
    (microsoft.public.vb.enterprise)
  • Re: Sorting a table by concatenating several fields in the same table
    ... I would not rely on either the sort order of the query or the OrderBy in the ... > to further sort any identical entries in the first field. ... > allow the user to select up to three fields for sorting. ...
    (microsoft.public.access.queries)