Share via

Order by not working

Anonymous
2015-06-03T18:58:16+00:00

I have a form with two sub-forms that I use to edit an SQL database.

When I filter records on the main form, my order by property on the sub-form does not work.

If I don't filter the records on the main form the order by property on the sub-form works well.

Why does the order by property on the sub-form not work wile records are filtered on the main form?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2015-06-03T20:28:46+00:00

    Thanks again Duane.  I made an access query of the ODBC linked SQL table.  Then I set my sub-form record source to be that query instead of the table.  In that query I set the YTC field to sort ascending and my sub-form records are in the order I need.

    John Green

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2015-06-03T19:46:39+00:00

    Thanks. My ORDER BY  is a form property.  I'll try to apply it to the record source and let you know what happens.  I don't have much experience with SQL but I do know how to get into SQL management studio.

    Was this answer helpful?

    0 comments No comments
  3. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2015-06-03T19:30:25+00:00

    Is your ORDER BY in a form property or in the record source SQL/query? I almost always apply the ORDER BY in the record source and haven't experienced any issues.

    I expect the filtering of the main form requeries the subform.

    BTW: "Question" isn't a very good subject line since every post in this forum is a question. It might have been better to use "Issue Sorting in subform" or similar.

    Was this answer helpful?

    0 comments No comments