can you set a sort order for TWO fields in a form?

Deborah

Registered User.
Local time
Today, 19:01
Joined
Dec 19, 2002
Messages
27
I have a form (set up with a datasheet view) and I want to sort the records by one field [Dept], and then by a second field [EquipmentNo], so that the [EquipmentNo] field is sorted in ascending order by [Dept]. Is there a way that I can sort more than one field in a form?

Thanks for your help.
 
If you always want the recordset sorted this way, add an order by clause to the form's recordsource query. If you are doing this on the fly, use the advanced sort options.
 
Deborah,

Are you using this form to enter data, or just to view it? If you only need to view data in datasheet view, the simplest way to do a multi-column sort is with a query rather than a form.
 
Either

Build a query that contains all the fields you need from your table plus it specifies sort order for the two fields, then make your form use the query.

or

Make the two fields become the primary key of the table.

Of course, in either case, you would make the primary sort be leftmost, then the secondary sort. In your case, [DeptNo] first, then the other field.
 
Hey, WOW, thanks, all of you for your help! Actually, right after I posted, I figured it out on my own. I didn't realise you could select more than one field when clicking the sort option - I feel like such a silly goose, bothering you for such a simple problem.

Thanks again :)
 

Users who are viewing this thread

Back
Top Bottom