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.
Add a new record to a table
- [Curtis] Every time your business hires a new employee, accepts a new order, or adds a customer, you need to enter that information into your database. In this movie I'll show you how to add a new record to a table. I have opened the course database and now I need to switch over to the visual basic editor. To do that I'll press alt F11. We're here in the visual basic editor and I need to add a code module. So, I will click insert, and module. And there I have my blank code module. I'll create a sub routine to add a new record to a table. So, I'll call it sub add new record. I'm not going to pass any information or any arguments so I'll just use an open and close parenthesis and enter. And you see that access adds the end sub statement marking the end of a sub routine. The first thing you need to do is to define a record set variable. So, I will dim myR, just short for my record set, as recordset. Next I need to assign a particular record set which could be a table or a query to that…
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)
-
-
-
-