Recordset navigation.

Fuga

Registered User.
Local time
Today, 17:30
Joined
Feb 28, 2002
Messages
566
If I have a number, how do I navigate to that row number in a recordset?

ie if i have 13, I want to go to the 13th record in a recordset.

Im using a DAO.recordset.

Fuga.
 
You can use the Move method on the recordset to move forward or backward a number of rows from your current position. You need to make sure that your current position is the first row:

Code:
rs.MoveFirst
rs.Move 13

You can move backwards by specifying negative values.

You can use the AbsolutePosition property to check where you are:

Code:
Debug.Print rs.AbsolutePosition

Note: AbsolutePosition is zero-based so should give you 12
 

Users who are viewing this thread

Back
Top Bottom