I have a Form with a (Continuous) Subform that lists the results of a query. There's a header within the Subform that has several elements you can click on to programatticaly change the OrderBy of the Subform then refresh it. An example of the code I use is here:
Private Sub CompanySort_Click()
If (Me.OrderBy = "Company") Then
Me.OrderBy = "Company DESC"
Else
Me.OrderBy = "Company"
End If
Me.Refresh
End Sub
This works fine when the Form (which is named "Results Subform") is run by itself, but doesn't work when run as part of the parent Form ("Results"). The name of the Subform control is "Report subform", can't remember why it's different now...
What am I doing wrong? I'm sure it's simple, but I'm stumped, any help is much appreciated.