When you're done working with a database object, you can close it using VBA. In this video, learn how to close an object.
- [Narrator] When a user finishes working…with a database object,…they can close it through the user interface.…However, if you'd like to close an object programmatically,…you can use the do command dot close method.…I'll demonstrate how to do that in this movie.…I am working in the course database,…and I have the Close Objects form open,…as well as the Customers table, Products report…and Categories form.…We'll work with all three of those other objects…in a moment.…
The Close Objects form, has three command buttons on it…and those are to close the form,…close the report, and close a table.…We'll start by closing the Categories form.…To assign VBA code to a command button…I need to be in Design View.…So I'll go ahead and on the Home tab,…click the View button's down arrow and click Design View.…And then I will right click the Close Form button.…At the top of the shortcut menu there's the Build Event…menu item, so I'll click that.…
Then in the Choose Builder dialog box…I'll click Code Builder and click OK.…I am in a VBA subroutine,…
- Working with macros
- Running a VBA procedure
- Debugging VBA code
- Defining variables, constants, and calculations
- Displaying a calculated result in a message box
- Repeating tasks with loops
- Manipulating database objects
- Adding, editing, and deleting records
- Looking up values in a table
- Automating processes with macros
Skill Level Advanced
What you should know1m 38s
1. Introduction to Visual Basic for Applications
2. Define Variables, Constants, and Calculations
3. Add Logic to Your VBA Code
4. Debug Your VBA Code
5. Manipulate Database Objects Using DoCmd
6. Read and Manipulate Table Data
7. Manipulate a Database Using the Application Object
8. Control Forms and Reports Using the Me Object
9. Automate Processes Using Macros
Next steps1m 7s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.