Order By Property

G

Guest

I have a form that has a subform on it and I want the subform to be sorted by
a date field, DateSent. However, when I enter [DateSent] DESC in the subforms
Order By property the form becomes locked so that information can't be
entered or edited but it is sorted. I tried to open the subform by itself and
it was not sorted even thought [DateSent] DESC was in the order by property
and the form was still locked. Could this be happening because of the
preformace issues? What can I do to get around this problem?
 
A

Allen Browne

The problem should be solvable.

Open the table that the subform is based on on design view.
Select the DateSent field.
Presumably it is a Date/Time type field?
In the lower pane set its Indexed property to:
Yes (Duplicates Okay)

If the field is already indexed that way, then perform a repair:
Tools | Database Utilities | Compact
If the index is damanged in any way, that should repair it.

Setting the subform's OrderBy property may not be enough. You also have to
set OrderByOn. That would explain why the sorting did not work when the form
was opened directly.

Another way to resolve the problem would be to create a query into the
table, and use that as the RecordSource for your subform instead of the
table. It is very easy to use the Sorting row of the query grid to get it
sorted as you want.
 

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