Chazelle Consulting Services  

Contact Us

Home  |  Profile  |  Consultants |  References   

 

 

Home
 
Databases
Services
Resources
 
Web Design
Services
Portfolio
 
QuickBooks
Services
 
Office Automation
Services
 
Networking
Services
 
 
 
 Sort Buttons for a Continuous List (Header Buttons)
 

To create header sorting buttons on a continuous form, do the following:

1. In the header section, create a button on top of the column you want to sort.

2. Attach the following code to the OnClick property of the button (the code assumes a field called "Lastname" and a button called "SortLastNameCmd").

Private Sub SortLastNameCmd_Click()
If Me.OrderBy = "lastname" Then
Me.OrderBy = "lastname Desc"
Else
Me.OrderBy = "lastname"
End If
Me.OrderByOn = True
End Sub

When pressed repeatedly, the button will sort alternatively Ascending and Descending.