Order By Property

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

On a sub form I am using, I tried setting the "Order By" property to DESC,
but it does not seem to work.

From help, it appears one only needs to append "DESC" to the end of the
field string and away it does. So, I typed in:

[tblPerformanceHistory]![CloseOutDate] DESC

Interestingly, it does not sort in decending order even when the form is
stand alone.

Have I misunderstood the explanation in Help? Or are their other forces at
work here?

What is the best way to sort the data on a sub-form by some field on the
form? (My app is an employee tracking system, so the parent form has
general employee data and the sub form has the employees history of
performance reviews. The parent and sub are linked on employee ID, and I
want the data on the subform sorted in decending order of date (i.e. most
recent at the top).

Thanks!!

Don
 
Don said:
On a sub form I am using, I tried setting the "Order By" property to DESC,
but it does not seem to work.

From help, it appears one only needs to append "DESC" to the end of the
field string and away it does. So, I typed in:

[tblPerformanceHistory]![CloseOutDate] DESC

Interestingly, it does not sort in decending order even when the form is
stand alone.

Have I misunderstood the explanation in Help? Or are their other forces at
work here?

What is the best way to sort the data on a sub-form by some field on the
form? (My app is an employee tracking system, so the parent form has
general employee data and the sub form has the employees history of
performance reviews. The parent and sub are linked on employee ID, and I
want the data on the subform sorted in decending order of date (i.e. most
recent at the top).

For a some confusing reason, Access exposes the Orderly property in the property
sheet even though this property does nothing at all unless the OrderByOn
property is set to True, which by the way, is a property NOT exposed in the
property sheet.

So in code you can use code...

Me.Orderly = "some setting"
Me.OrderByOn = True

....and it will work. Just putting an Orderly entry in the property sheet seems
to be a useless act. I generally avoid the Orderly properties and just use a
RecordSource with the sorting I want. The form will generally honor that sort
as long as the user doesn't apply a different one with the GUI.
 
Rick,

Thanks for the advice! I will give it a try.

Don








Rick Brandt said:
Don said:
On a sub form I am using, I tried setting the "Order By" property to DESC,
but it does not seem to work.

From help, it appears one only needs to append "DESC" to the end of the
field string and away it does. So, I typed in:

[tblPerformanceHistory]![CloseOutDate] DESC

Interestingly, it does not sort in decending order even when the form is
stand alone.

Have I misunderstood the explanation in Help? Or are their other forces at
work here?

What is the best way to sort the data on a sub-form by some field on the
form? (My app is an employee tracking system, so the parent form has
general employee data and the sub form has the employees history of
performance reviews. The parent and sub are linked on employee ID, and I
want the data on the subform sorted in decending order of date (i.e. most
recent at the top).

For a some confusing reason, Access exposes the Orderly property in the property
sheet even though this property does nothing at all unless the OrderByOn
property is set to True, which by the way, is a property NOT exposed in the
property sheet.

So in code you can use code...

Me.Orderly = "some setting"
Me.OrderByOn = True

...and it will work. Just putting an Orderly entry in the property sheet seems
to be a useless act. I generally avoid the Orderly properties and just use a
RecordSource with the sorting I want. The form will generally honor that sort
as long as the user doesn't apply a different one with the GUI.
 
Back
Top