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
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Display every row in a table (recordset)5m 20s
-
(Locked)
Add a new record to a table5m 54s
-
(Locked)
Edit values in an existing table row4m 21s
-
(Locked)
Preserve data integrity using transactions7m 37s
-
(Locked)
Display a table property using the TableDef object5m 20s
-
(Locked)
Close a recordset3m 8s
-
(Locked)
Delete the current record5m 28s
-
Find records within a table6m 37s
-
(Locked)
Move within a recordset4m 52s
-
(Locked)
Count the records in a recordset5m 26s
-
(Locked)
-
-
-
-