From: Williams on
I have a form that I always want to appear with the records displayed in sort
order. The end users may sort the data by any column desired, but whenever
the form is displayed I want it to open up with the records sorted by Date.
The form is based upon a query which identified that the DATE field should be
sorted in Ascending order. The properties of the form have also been
updated to reflect that the records should be "Ordered by" DATE.

Whenever a user opens the form and sorts by an alternate field the form
retains the sort order of the last user even though the form does not request
to save the layout changes. How can I prevent this from happening?
From: fredg on
On Tue, 4 May 2010 12:24:01 -0700, Williams wrote:

> I have a form that I always want to appear with the records displayed in sort
> order. The end users may sort the data by any column desired, but whenever
> the form is displayed I want it to open up with the records sorted by Date.
> The form is based upon a query which identified that the DATE field should be
> sorted in Ascending order. The properties of the form have also been
> updated to reflect that the records should be "Ordered by" DATE.
>
> Whenever a user opens the form and sorts by an alternate field the form
> retains the sort order of the last user even though the form does not request
> to save the layout changes. How can I prevent this from happening?

The Form's recordsource is a query ordered by the [DateField]?
Turn off the Form's OrderByOn property in the Form's Load event.

Me.OrderByOn = False

The query's sort will appear on the form.
When the user changes the sort the OrderByOn property will be set to
True until the next time the form is opened or the user right-clicks
on the form and selects Remove Filter/Sort.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail