Yes, I had considered that. But I wanted to do it at the table
level within DAO, if it could be done. A workaround that
accomplished the objective was to switch the order of the
two fields. Making [MovieName] the first field and making
its Indexed Property setting Yes No Duplicates did the
trick. But, do you know if there is a way to sort the
RecordSet after opening with DAO?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxx
On Tue, 30 Nov 2004 21:35:21 -0600, "Rick Brandt"
<ri*********@hotmail.com> wrote:
"MLH" <CR**@NorthState.net> wrote in message
news:07********************************@4ax.com.. . In the code snippet below, MyMovies is a table of movie names.
First field is a unique long integer ID. Second field is text string
containing movie name. The second field's Indexed Property
setting is Yes (no duplicates).
I would like to open the dynaset sorted on the first field rather
than on the second field. First field is [MovieID]. Second field is
[MovieName]. Anyone know how to structure the DAO so the
table is opened sorted on the first field? Or, how to re-sort it after
the Recordset is already opened?
Dim MyDB As Database, MySet As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MySet = MyDB.OpenRecordset("MyMovies", DB_OPEN_DYNASET)
MySet.MoveLast
Base the RecordSet on a SQL Statement instead if the raw table.
Dim MyDB As Database, MySet As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MySet = MyDB.OpenRecordset("SELECT * FROM MyMovies ORDER BY MovieID",
DB_OPEN_DYNASET)
MySet.MoveLast