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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Access Tables

Status
Not open for further replies.

zggs90

Programmer
Sep 3, 2001
58
0
0
GB
Can anyone help me write a bit of VB code to sort an Access Table by a specific field?

I can sort the data when I read it but would like the table to remain sorted.

Thanks

Geoff
 
its not VB code......but a SQL statement......maybe you can tell us if your using Access, SQL Server....etc. There are so many ways to sort data by a field

'''''''''''''''''''''''''''''''''''''''''
Dim sSQL as String

'Ascending
sSQL = "SELECT * FROM YOUR_TABLE ORDER BY YOUR_FIELD"

'Descending
sSQL = "SELECT * FROM YOUR_TABLE ORDER BY YOUR_FIELD DESC"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Good Luck




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top