I have a form that has several subforms on it seperated by the tabs object.
Most of the subforms have their data attribute set to SQL, where the data is
ordered.
One of the subforms has it's data attribute set to a query, where the data is
ordered.
When I look at the form with it's subform with a filter applied, called from
code, the
subform with the data set by query does not order it's results. The other
subforms
are fine!
I'm going to try and duplicate this problem, but wondered if anyone had ever
heard
of such a thing ?
Rohan.
Yes, if you apply a filter, the sorting can get messed up.
You could work around that by setting the OrderBy property of the subform.
(Don't forget to set OrderByOn as well.)

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I have a form that has several subforms on it seperated by the tabs object.
>
[quoted text clipped - 19 lines]
>
> Rohan
Rohan - 30 Apr 2007 06:28 GMT
>Yes, if you apply a filter, the sorting can get messed up.
>
>You could work around that by setting the OrderBy property of the subform.
>(Don't forget to set OrderByOn as well.)
Couldn't get this to work. Where is the OrderByOn ? I'm using forms.
Rohan.
Allen Browne - 30 Apr 2007 06:38 GMT
In code:
Me.OrderBy= "[City] DESC"
Me.OrderByOn = True
That sorts in descending order on the field named City.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>>Yes, if you apply a filter, the sorting can get messed up.
>>
[quoted text clipped - 4 lines]
>
> Rohan.