Moving Through the Records in a Recordset:MovePrevious - To the previous record in a recordset : Recordset Cursor « Access « VBA / Excel / Access / Word
Moving Through the Records in a Recordset:MovePrevious - To the previous record in a recordset
Sub RecordsetMovements()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.Open "Select * from Employees"
Debug.Print rst("EmployeeID")
rst.MoveNext
Debug.Print rst("EmployeeID")
rst.MoveLast
Debug.Print rst("EmployeeID")
rst.MovePrevious
Debug.Print rst("EmployeeID")
rst.MoveFirst
Debug.Print rst("EmployeeID")
rst.Close
Set rst = Nothing
End Sub