Hiya,
Here is what I did: I created a table with thrww columns, ID, Alpha, and Number. I set these values:
ID Alpha Number
1 A 3
2 B 2
3 C 1
Then I created a query that pulled all the fields in this table sorted by Alpha ASC, which sounds like what you did. Query was called "a"
Then I created a form basedon the table, made it a continuous form, and put the Alpha and Number fields in columns, and then put a button at the header over Alpha. I used this code on the Alpha button:
[Forms]![afrm].[RecordSource] = "a"
This changed the recordsource for the form to the query called a where the alpha column was sorted ascending.
I then used this code on the button over the Number column:
[Forms]![afrm].[RecordSource] = "SELECT * FROM Table1 ORDER BY [Num] ASC;"
So this does the same thing without having to call an external query, and did the same thing, it order the number column ASC.
Does this do what you want?
mmcdonal
|