From the course: Access: VBA

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Move within a recordset

Move within a recordset

From the course: Access: VBA

Start my 1-month free trial

Move within a recordset

- [Narrator] Tables usually contain lots of data. If you want to let your users move within an access table, or do so within a subroutine, you can do that, using code that implements the move family of methods. I'll demonstrate how to use the move family, that's just the unofficial name I call it, of methods in Access VBA. I have opened the course database, and I'll press Alt + F11 to move to the Visual Basic editor. I need a code module, so I'll open the Insert menu and click Module. Now I can create a subroutine and work with a table, in this case I'll do the customer's table. So I'll type Sub, and I'll just call it MoveAround, I won't pass any arguments so I'll type in open and close parentheses. Then Enter a couple of times to get the End Sub line and some white space. The first thing I need to do is to create a record set variable that will hold the table that I open. So it will be Dim myR, and myR is just what I'm calling this variable, there's nothing special about it, As…

Contents