Sort Data on my form

romio

Registered User.
Local time
Today, 05:34
Joined
Apr 20, 2005
Messages
68
When I open my form the data are sorted through the ID, How can I change that to be sorted through the Year? On my form properties is that the Filter is responsible for sorting?
 
The best way I know is to set the RecordSource of the form. I assume currently that the recordsource is bound to a Table. Instead:

1. Set the form's recordsource to a Query which is simply requesting all records from the source Table
2. In the query set the Sort property of the field you want to sort by to Ascending.
 
iago18 said:
The best way I know is to set the RecordSource of the form. I assume currently that the recordsource is bound to a Table. Instead:

1. Set the form's recordsource to a Query which is simply requesting all records from the source Table
2. In the query set the Sort property of the field you want to sort by to Ascending.

Thanks iago18.
 
well its not working yet, even though i have it sroted, the last record will always appear as last record, Why?
 
i have tried have a refresh command box with the following:
Code:
Dim strSql As String
strSql = "SELECT Records.ID, Records.Name, Records.Description, Records.Department, Records.ProblemDesc, Records.SolutionDesc, Records.ITName, Records.RDay, Records.RMonth, Records.RYear, Records.RTime, Records.AMPM FROM Records ORDER BY Records.RDay, Records.RMonth, Records.RYear"

But still not working
 
Have you taken the SQL string you've created and set it as the RecordSource of the form?

1. Open the form in Design View
2. Right click on the Form and select Properties
3. Find the form's Recordsource property, click into it, then select the '...' button next to it
4. Set the recordsource of the form in here using a query like the one described in your SQL statement.
 

Users who are viewing this thread

Back
Top Bottom