How to set sequence a subform's Datasheet

D

Dean Slindee

I have a subform that is displaying with a Datasheet Default View property.
The Record Source for the subform is a table.

In the subform's "Order By" property I have specified the following
"TestDate DESC". TestDate is a column in the table named as the Record
Source for the subform.



Problem is, the Order By property is being ignored. Is the Order By only
valid on main forms?



Thanks in advance.

Dean S
 
J

John W. Vinson

I have a subform that is displaying with a Datasheet Default View property.
The Record Source for the subform is a table.

In the subform's "Order By" property I have specified the following
"TestDate DESC". TestDate is a column in the table named as the Record
Source for the subform.



Problem is, the Order By property is being ignored. Is the Order By only
valid on main forms?

No, but you must set the Subform's OrderByOn property to True (in code, it's
not exposed in the form properties).

In general it's a lot simpler to just base the form on a sorted Query (rather
than on a table). This won't interfere with updating, and (if the sort field
is indexed, as it should be) won't noticably affect performance.

John W. Vinson [MVP]
 

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