Sorting

twosides

Registered User.
Local time
Today, 04:12
Joined
Jul 19, 2005
Messages
38
I use this code to sort aphabetically on a field. Double clicking the header (DeptLbl) simply sorts it fine.
But I want it to sort it on this field first but then on a sub field called 'Room'.

In other words I want it in Department order first followed by Room order next.

Any ideas ???

Cheers



Private Sub DeptLbl_Click()
If Me.OrderBy = "[Department]" Then
Me.OrderBy = "[Department] DESC"
Else
Me.OrderBy = "[Department]"
Me.OrderByOn = True
End If
End Sub
 
Order by takes a list of columns, so [Department], [Room] would sort by department first, then room. The DESC options can be used also for each column as such.
[Department] DESC, [Room] for desc. department and asc. room or
[Department] DESC, [Room] DESC for descending on both
 

Users who are viewing this thread

Back
Top Bottom