Sort different columns in a List box

scheeps

Registered User.
Local time
Tomorrow, 07:16
Joined
Mar 10, 2011
Messages
82
I've got a 5 column list box and the user needs to be able to sort any one of the 5 columns.

I've got an A-Z and Z-A button above each column, which works perfectly well, but it looks ridiculous.

Isn't there a better way of sorting a list box? Maybe only 1 button which toggles between A-Z and Z-A as you sort either way for each column.

Or is there a better way in doing this?
 
Place a Sort command button on the form. In it's Caption Property enter "A-Z" Behind the Sort command button's OnClick event, place this:
Code:
Private Sub SortButton_Click()
  If SortButton.Caption = “A-Z”  Then
    SortButton.Caption = "Z-A"
    'Put code here to sort A to Z.
  Else
    SortButton.Caption = "A-Z"
    'Put code here to sort Z to A.
  End If
End Sub
Linq ;0)>
 
Linq , thanks for the quick and simple solution but I think I'm going to add some complexity to it. I should have probably mentioned it in my first post.

Currently my buttons contain the internal A-Z and Z-A sorting bitmap images. Is is possible to change the internal Access bitmap images of a command button with VBA?

I believe it isn't as simple as just to change the Picture property.

Do you (or anyone else) have any suggestions?
 

Users who are viewing this thread

Back
Top Bottom