Sub exaRecordsetMove()
Dim db As Database
Dim rsTable As Recordset
Dim rsDyna As Recordset
Set db = CurrentDb
Set rsTable = db.OpenRecordset("Books")
Debug.Print "Books indexed by PubID/Title:"
rsTable.Index = "PubTitle"
rsTable.MoveFirst
Do While Not rsTable.EOF
Debug.Print rsTable!PubID & " / " & rsTable!Title
rsTable.MoveNext
Loop
Debug.Print "Dynaset-type recordset order:"
Set rsDyna = db.OpenRecordset("Books", dbOpenDynaset)
rsDyna.MoveFirst
Do While Not rsDyna.EOF
Debug.Print rsDyna!PubID & " / " & rsDyna!Title
rsDyna.MoveNext
Loop
rsTable.Close
rsDyna.Close
End Sub
|