Presumably you have an unbound combo that contains the names of
the fields you may wish to sort by?
If so, the combo's AfterUpdate event procedure would call the
code like this:
If Me.dirty Then Me.Dirty = False 'save any edits
With Me.[cboSortBy] 'Use your combo name here
If IsNull(.Value) Then
Me.OrderByOn = False
Else
Call SortForm(Me, .Value)
End if
End With
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
message
Allen,
I'm slightly confused because your answer makes a lot of
references to a
form. Is your code for a continous form or for a Combo Box;
because I am
using a combo box; very similar to the one that the 'find
record' wizard
generates, except I am using your superb, quicker code that I
found on your
website.
Also, if this is for a combo box, where do I put the code?