Functions perform calculations on data that can be called by other procedures. In this video, learn how to create a function.
- [Instructor] There are two types of procedures…that you can create in Access VBA.…Those are subroutines and functions.…In this movie I will discuss functions.…A function returns a value…that you can use in a calculation,…where a subroutine only does calculations within…that particular subroutine.…I show you how to create a subroutine…elsewhere in the course.…So in this movie I will show you how to create a function.…I'll start by switching to the Visual Basic Editor.…So I'll press Alt F11 and then once I'm here,…I'll go to the insert menu and click module.…
And my code module appears.…To create a function, I will type the word function…and now I need to give the function a name.…For this straight forward example I'll just type Multbypi,…and as you can imagine we'll be multiplying a number by pi.…Then a space and a left parentheses.…We need to give this particular function…a value to work with.…It's called an argument.…And we need to define it, or them, within parentheses.…
So I'll type double length as double…
- 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.