Resorting Records on a Continuous Form

wcboyd

Registered User.
Local time
Yesterday, 19:33
Joined
Aug 30, 2004
Messages
50
Hello All,

I have a continuous form that I want to sort/re-sort based on clicking a button in the header.

One button is for sorting the records by Project Name and the other is sorting by Project Tracking Code.

The form is based on an SQL Select statement.
Here is the click event code for the Project Name button:

Private Sub Command86_Click()
Dim ctlFrm As Form

Forms![Project - Maintain All Projects].OrderBy = ProjectNm
Set ctlFrm = Forms![Project - Maintain All Projects]
ctlFrm.Requery
End Sub

But this is not working. Any ideas?

Thanks.
 
Set focus to the relevant field first and then use the SortAscending/Descending method
 
Thanks Rich. That is almost too easy.
 

Users who are viewing this thread

Back
Top Bottom