help with sort button

E

edward keith

I have a form that shows all records on the screen at the same time. On My
Header I put buttons over every column. I would like to make it if I click
on a button above a column it will sort by that column. Can someone help
please?
Thanks, Edward Keith
 
M

Marshall Barton

edward said:
I have a form that shows all records on the screen at the same time. On My
Header I put buttons over every column. I would like to make it if I click
on a button above a column it will sort by that column.


Use code in each button"s Click event procedure:

Me.OrderBy = "fieldname"
Me.OrderByOn = True
 
Top