Sorting problem

M

Mike

Hi All,

I wish to sort by different fields at the user's discretion by using buttons
as headers and clicking the button sorts ascending or desending if it was
ascending previously.

I have the following code

Private Sub Label9_Click()
If Me.OrderBy = "Shipper City" Then
Me.OrderBy = "Shipper City DESC"
Else
Me.OrderBy = "Shipper City"
End If
Me.OrderByOn = True

End Sub

It sorts ascending but does not reverse when clicked again like I believe it
should. Any ideas?

Thanks in advance.
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top