I have a main form with a subform. The main form loads with records ascending by ID as they are stored in the table which is correct.
The subform has an Order on Load property which sorts by year descending ( the latest is always displayed first).
When the forms open the sort is perfect and whether cycling through records or picking specific ones, the year sort remains correct.
The main form has a number of filters Which when used, filter records on the main foerm but remove the subform year sort. On the face of it, they come in table order which is generally ascending.
Having used a filter, the sort doesn't kick back in until the form is closed and loaded again.
The code for the filters is generally the same and pasted below. I think, but i'm not certain, that I need another OrderBy statement, perhaps somewhere in the filter code.
Can anyone confirm please?
Private Sub Command270_Click()
If Me.Form.FilterOn = True Then
Me.Form.Filter = ""
Me.Form.FilterOn = False
Me!Command270.Caption = "Apply LAPSED Filter"
Me.Command270.BackColor = RGB(0, 255, 0)
[FltrStatus] = Null
[Combo290].Requery
Else:
Me.Form.Filter = "[STATUS] = 'LAPSED'"
Me.Form.FilterOn = True
Me!Command270.Caption = "Remove LAPSED Filter"
Me.Command270.BackColor = RGB(255, 0, 0)
[FltrStatus] = "LAPSED"
[Combo290].Requery
End If
Myfilter = Me.Form.Filter
End Sub