Orderby multiple fields

tweetyksc

Registered User.
Local time
Today, 12:35
Joined
Aug 23, 2001
Messages
87
I have a report that is sorted by the user from a form. If they choose to sort by district, I want it to also sort by name within the districts.
I can't seem to get the report to sort for the seconf field.
It sorts by the district but not the name within the district.
I think I have it coded correctly....?

-------------------------------------
Private Sub Report_Open(Cancel As Integer)

Me.OrderByOn = True

Select Case Forms!frmstartup.grpSlsRepSort

Case 1
Me.OrderBy = "Employee Name"
Case 2
Me.OrderBy = "Dist, Employee Name"
End Select

End Sub
------------------------------------------
 
I think the space in 'Employee Name' is the problem. I would fix that. Or else try:


Private Sub Report_Open(Cancel As Integer)

Me.OrderByOn = True

Select Case Forms!frmstartup.grpSlsRepSort

Case 1
Me.OrderBy = "[Employee Name]"
Case 2
Me.OrderBy = "[Dist], [Employee Name]"
End Select

End Sub


kh
 
Thanks for replying.
This is a database created by someone else; I'd have to go through everything to remove the space.
Tried the brackets with same results. Not doing the secondary sort (name).
 

Users who are viewing this thread

Back
Top Bottom