Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort Table

Status
Not open for further replies.

kritimehrotra

Programmer
Jul 28, 2006
2
CA
Hi,

I was wondering if there is a way to use VBA to sort an existing table in the database. What I want is that after the code is executed, if I physically open the table, it should be sorted in ascending order of a particular field (it is a numerical field, although I doubt that is of any particular importance).

Also, I noticed that even if I physically go into the table and sort it and save the changes, the form based on that table does not display records in this sorted order, but rather displays them in the original unsorted order.

So I need a way to use VBA to sort the table, and to ensure that the form based on the table displays the records in this sorted order.

Thank you,
Kriti
 
In a RDBMS table's rows have NO peculiar order.
You have to bind your form to a sorted query or play with its OrderBy and OrderByOn properties.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top