Kamis, 26 November 2015

[MS_AccessPros] Sorting question

 

I have a form which I created using the Split Form tool on the Forms
section of the ribbon's Create tab. The form's data source is a query.
The datasheet view at the bottom of the screen has room to display about
a dozen records. Each record has a line number field, iLineNr. When the
form opens, the records are sorted by iLineNr based on the ORDER BY part
of the query.

When the user enters data into or changes data in the iLineNr field, I'd
like to resort the records displayed in the form's datasheet by iLineNr
ascending. I think the iLineNr LostFocus event is the place to do the
sorting. Some internet sites suggested using a recordset and this line
of code but I haven't been able to get it to work: Set rstSortByLineNr =
dbSortByLineNr.OpenRecordset("query", dbOpenDynaset) where for "query" I
have the form's data source query.

Is this the way to go about the sort? Is there a better way? Thanks.

Steve

__._,_.___

Posted by: Steve5 <thaw5@suddenlink.net>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (9)

.

__,_._,___

Tidak ada komentar:

Posting Komentar