Database records often contain numerical values that provide important information. In this video, learn how to summarize values in a table field.
- [Instructor] You can use VBA code…to view, edit, or delete individual rows,…but you can also use VBA…to summarize all the values in a field in one calculation.…For example, you could find the average…or a sum of the values in a quantity column.…In this movie, I will show you how to create…the code to do just that.…I have opened the course database,…and I'll press Alt + F11 to go to the Visual Basic Editor.…I need to create a code module,…so I'll click Insert to open the Insert menu,…and click Module.…
Now I can create a subroutine that summarizes…the values in the quantity column of the orders table.…So I will call it Sub, 'cause I'm creating a subroutine,…Summarize, and then open and close parentheses…'cause we're not passing any arguments.…I will declare my variable for the values.…So Dim…dValue…as Double.…And then just a MsgBox with the following prompt,…that is the text that's displayed.…
And that will be DAvg, followed by a left parenthesis.…Then we need to have the expression and the domain.…The expression is the table column or field.…
- 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.