Datasheet Sheet View – Descending Sort

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

I have a sub-form in data sheet view. The record source
query is sorted in descending order. This returns the data
so that I see the newest record on top of the list. When I
go to add another record I have to scroll to the end of
the list.
Is there any way of having the add new record line at the
top of the form?

Any help appreciated.

Nick
 
Nick said:
I have a sub-form in data sheet view. The record source
query is sorted in descending order. This returns the data
so that I see the newest record on top of the list. When I
go to add another record I have to scroll to the end of
the list.
Is there any way of having the add new record line at the
top of the form?

Only by means of a trick. Set the AllowAdditions property of the
original subform to No. Add another subform based on the same
recordsource to the main form, just big enough to display a single
record, and set its DataEntry property to Yes. In the AfterInsert event
of that subform, run code to requery the other subform; e.g.,

Private Sub Form_AfterInsert()
Me.Parent!sfExistingRecordsSubform.Requery
End Sub

If you tinker with the format and properties of the subforms, you can
get it to look very much as if the "new record" line is part of the same
subform as the "existing records" subform, but positioned at the top.
You may also have to do some tinkering if you want to be able to tab
naturally between the subforms. There are tricks for that, too.
 
Thakns alot. This work well. Is there any way of turning
off the column headings or do you just have to put up with
them?
I appreciate your help.
Regards
Nick
 
Nick said:
Thakns alot. This work well. Is there any way of turning
off the column headings or do you just have to put up with
them?

I don't think there's any way to turn off the column headers in
datasheet view. I would use continuous forms instead, and format them
to look like datasheets if you like.
 
Back
Top