"Order by" on command button

SueBK

Registered User.
Local time
Tomorrow, 04:15
Joined
Apr 2, 2009
Messages
197
I have a form that shows personnel - first name, last name, affliated company. I would like to put a command button on the form to enable users to sort the list by any of those fields (even if it means three buttons - I don't mind). I found "me.orderby" but then I don't know what happens next in the code.
 
You just put

Me.OrderBy = "FieldName1, FieldName2, FieldName3"
Me.OrderByOn = True

and if you wanted any descending sorts you can use

Me.OrderBy = "FieldName1, FieldName2 Desc, FieldName3"
Me.OrderByOn = True
 
I knew it had to be simple. One day I will find a VB programming book and answer the silly questions for myself. In the meantime, this forum keeps me at least partially sane.
 

Users who are viewing this thread

Back
Top Bottom