G
Guest
I use the method below, from one of the MVP sites, to change the sort order
of records being displayed. This works find in fields containing text value
but i need a method which will allow me to sort the data by the text held in
a combo, using this method on a combo sorts by the value of the box which is
usually a number and not the text.
Anyone help ?
Private Sub txtOrderID_DblClick(Cancel As Integer)
Call ChangeSort("OrderID")
End Sub
Private Sub ChangeSort(FieldName As String)
If Me.OrderBy <> FieldName Then
Me.OrderBy = FieldName
Else
Me.OrderBy = FieldName & " DESC"
End If
Me.OrderByOn = True
End Sub
of records being displayed. This works find in fields containing text value
but i need a method which will allow me to sort the data by the text held in
a combo, using this method on a combo sorts by the value of the box which is
usually a number and not the text.
Anyone help ?
Private Sub txtOrderID_DblClick(Cancel As Integer)
Call ChangeSort("OrderID")
End Sub
Private Sub ChangeSort(FieldName As String)
If Me.OrderBy <> FieldName Then
Me.OrderBy = FieldName
Else
Me.OrderBy = FieldName & " DESC"
End If
Me.OrderByOn = True
End Sub