Perhaps you could tell us exactly what you are trying to do in plain English.
If you have this SQL (the query) as the recordsource of your Form/Report
Code:
SELECT tblStudentInformation.StudentID
, tblStudentInformation.FirstName
, tblStudentInformation.LastName
, tblStudentInformation.Address
, tblStudentInformation.Town
, tblStudentInformation.City
, tblStudentInformation.County
FROM tblStudentInformation;
You could alter the recordsource with an Order By statement
The fields are "numbered 1 thru 7".
---To SORT by FirstName, you can alter the recordsource with
Order By 2 (since Firstname is field #2) by default you get ASCending
--To Sort by County DESCending , you could alter the recordsource with
Order By 7 DESC;
When you choose the field to Sort By in your Form, have an After Update event which alters the Recordsource as shown here, then requery the Form. (untested)
I used the version of the mdb posted by rzw0wr
Here's his query with my Order By
SELECT tblStudentInformation.StudentID, tblStudentInformation.FirstName AS [Student Name], tblStudentInformation.LastName, tblStudentInformation.Address, tblStudentInformation.Town, tblStudentInformation.City, tblStudentInformation.County
FROM tblStudentInformation order by 2;
Here is the Order by 7 DESC example
SELECT tblStudentInformation.StudentID, tblStudentInformation.FirstName AS [Student Name], tblStudentInformation.LastName, tblStudentInformation.Address, tblStudentInformation.Town, tblStudentInformation.City, tblStudentInformation.County
FROM tblStudentInformation order by 7 DESC;
see the corresponding jpgs for the query results