Subform OrderBy issue

AbbottF

Registered User.
Local time
Today, 15:53
Joined
Jan 22, 2013
Messages
25
I have a subform in a tab on my main form. The filter works properly...I see all the records I expect. But the OrderBy on the date field does not work, the rows are shown in ascending primary key sequence. The code follows ..
Any suggestions?

Code:
Private Sub Form_Load()
    If Me.Recordset.BOF <> Me.Recordset.EOF Then
        Me.filter = "ContactID = Contact.ID And CategoryIsFinancial = True"
        Me.OrderBy = "ActiveDate DESC"
    End If
End Sub
 
I think you need this at the end:

Me.OrderByOn = True
 
Paul, I tried that, but it still displays in primary key order. It did seem like an obvious fix.
Thanks
Abbott
 
Is the filter applying (is the code running at all)? Can you post the db here?
 
Paul,
I changed sort sequence of the query and that fixed everything.
Thanks
 
No problem, glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom