Viewers: in countries Watching now:
Enhance productivity by automating routine tasks and providing custom functionality not built into Access with a few basics in VBA code. Author Curt Frye introduces object-oriented programming and provides database designers with a foundation in the Access object model and the Visual Basic for Applications (VBA) programming language. The course covers automating tasks with macros, working in the Visual Basic Editor, writing functions, adding logic, reading data, controlling forms, and more.
When you read about VBA programming you might see the writers refer to subroutines and functions. Even though some authors use the two terms synonymously, they actually mean different things. The generic name for both subroutines and functions is a procedure. To demonstrate how to create the subroutine, I'll press Alt+F11 to open up the Visual Basic Editor and then click Insert > Module. You create a subroutine by opening a code module and then typing Sub, then a space, and then the subroutine's name.
The subroutine's name can have no internal spaces, and it has to start with a letter. So in this case I will make it Welcome, then type left and right parenthesis--in this case with nothing between them--and then press Enter. When you press, Enter Access creates the subroutine, adds an End Sub statement, and gives you a blank line where you can start typing your code. In this case, I'll have a display or message box that says, "Welcome to the Shipment Tracking database." So MsgBox and don't worry; we'll cover message boxes later. Then the space, left parenthesis, double quotes, and then I'll just type in "Welcome to the Shipment Tracking database," then a period, and double quotes, and a right parenthesis.
Now when I press F5 Access runs the macro and displays my message box. Subroutines are the backbone of Access programming. You use them to manipulate database objects and add functionality for your users.
There are currently no FAQs about Up and Running with VBA in Access.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.