Form won't match query sort order

  • Thread starter TomK via AccessMonster.com
  • Start date
T

TomK via AccessMonster.com

OK, this is starting to drive me a little crazy now...and I'm sure I'm
overlooking something obvious. I have a form that is bound to a query. The
query is set to sort on Field_1 (Ascending), then by Field_2 (Asc), and when
I run the query it is sorted correctly. But, when I run the form that is
bound to it, the sort order insists on being by Field_3. I've tried just
deleting the Properties:Sort Order for the form and I've also tried setting
it to Field_1, Field_2. But, when I open the form it sets it back to Field_3.
What the heck is going on here? Appreciate any help!

Thanks,
Tom
 
A

Allen Browne

A form should work as you expect, but if you are stuck you might set
OrderByOn on the Open event procedure of the form.

This kind of thing:

Private Sub Form_Open(Cancel As Integer)
Me.OrderBy ="[Field_1], [Field_2]"
Me.OrderByOn = True
End Sub
 
T

TomK via AccessMonster.com

Allen said:
A form should work as you expect, but if you are stuck you might set
OrderByOn on the Open event procedure of the form.

This kind of thing:

Private Sub Form_Open(Cancel As Integer)
Me.OrderBy ="[Field_1], [Field_2]"
Me.OrderByOn = True
End Sub
OK, this is starting to drive me a little crazy now...and I'm sure I'm
overlooking something obvious. I have a form that is bound to a query.
[quoted text clipped - 8 lines]
Field_3.
What the heck is going on here? Appreciate any help!


Eureka! Thanks Allen!! You pointed me in the right direction. Turns out
there was already a Me.OrderBy ="[Field_3]" line in there that I didn't know
about. That explains it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top