
Explore how VBA helps you become a programmer inside Microsoft Access. Learn about variables, functions, subroutines, recordsets, dialog boxes, error handling, and protecting your database.
Use the chapter-specific working files; open the correct chapter database and import forms, reports, and modules as needed, using the sales incorporated underscore copy when available.
Import the sample databases' tables from the data-only Access file via the external data ribbon, or link them to create a standalone working copy that avoids altering the data-only source.
Explore how VBA powers automation in Microsoft Access by outlining the main procedures, Sub and Function, and explain that VBA is not case sensitive and how naming conventions improve readability.
Explore where VBA lives in Access: understand standard vs class modules, how code is hidden or exposed, and how to open and edit VBA via the Visual Basic Editor.
Take a quick tour of the VBA editor in Microsoft Access, navigating the code window, explorer, properties, and intermediate window, and test code within the editor.
Explore the Visual Basic Editor's explorer and properties windows to view objects, embedded class modules, and form or report properties. Jump between Access and code with View Code easily today.
Learn to use the immediate window in the Visual Basic Editor to run and test VBA code, call functions with a question mark, and spot errors without building in Access.
Explore when to use macros versus VBA in Access and how to convert macros to VBA for more control, error handling, and password-protected code.
Begin VBA programming in Access by creating a standard module in your database, using the Visual Basic Editor, enabling Option Compare Database and Option Explicit, then saving and reopening modules.
Create VBA procedures by defining subroutines and functions in a standard module, using clear syntax, start and end markers, and distinguishing public versus private scope for database-wide access.
Learn to annotate Visual Basic for Microsoft Access code by adding comments to subroutines and functions using an apostrophe, improving readability and future maintenance.
Explore the common VBA data types, including byte, boolean, integer, long, single, currency, decimal, date, object, string, and variant, and learn to declare variables to store data in Access.
Learn how to declare and pass parameters to VBA procedures, specify data types like string, integer, double, and camelCase parameter names, and distinguish subroutines from functions that return values.
Declare variables and constants in VBA for Access. Learn naming rules, data types, and how to assign values using dim and const.
Learn how to declare and work with arrays in VBA, create one dimensional and two dimensional arrays, assign values to elements, and access data using array names and indices.
Declare variables with the appropriate scope to control their lifetime within procedures or across the module. Use module-level public declarations for global access, or private ones to restrict scope.
Use camel case and avoid spaces or underscores for VBA variables, then prefix names with three-letter data type tags (like int or str) to reveal the type at a glance.
Master how to handle multiple line commands in VBA for Microsoft Access by using the underscore for line continuation, avoiding breaking strings, and safely concatenating literals with ampersands.
Use the me keyword to reference the current form in Visual Basic for Microsoft Access, list properties and objects, and reduce errors when accessing item title values inside class modules.
Learn to implement do loops in VBA with do while, do until, and variations that repeat code until or while a condition holds, including exiting early with exit do.
Explore the while loop in VBA for Access, compare it to the do loop, and see how the condition governs execution with X incrementing to 100 and no exit option.
Explore the for next loop in Visual Basic for Access, defining start and end values, optional step, including negative steps, and iterating through arrays.
Explore if statements in VBA, including then, else, and end if, to run code under conditions. Master operators (=, <, >, <=, >=, <>), and, or, xor, not for logic.
Learn how to use the select case statement in Visual Basic for Microsoft Access, comparing it to if statements, handling string values, ranges, and default cases with case else.
Explore the Access object model to manipulate every form, report, and control in an Access database using VBA, including collection hierarchies, properties, and methods.
Learn to reference form controls in Visual Basic for Access and change properties such as the item title and visibility for new items or the current record.
Discover how to use the Access DoCmd special object to run built-in methods, open forms, close objects, and pass optional parameters with the correct syntax.
Explore how each Access form has its own class module for form-specific VBA, enabling code view and event-driven subroutines triggered by controls.
Learn to enable and disable individual form controls using a button and an on click event. Toggle a field’s state with a true/false condition and manage focus for safe switching.
Learn to hide and show form controls in a Microsoft Access form, including text boxes, by toggling visibility and enabling or disabling inputs with buttons and menu options.
Lock and unlock a form control by toggling its locked property, distinguishing read only from disabled and hidden states. Demonstrate with a text box and a button to toggle lock.
Add VBA routines to access form events using the class module, triggering on current, load, after insert, delete, and close, with price disabled when not available.
Use VBA in Access to control an object's back, border, and font colors with form current and conditional logic when the price exceeds 9, using built in color constants.
Define and use custom colors in Visual Basic for Microsoft Access by using RGB values, 0–255, with functions and modules to create reusable colors for form elements.
Learn to set font properties in Microsoft Access with VBA, including bold, underline, typeface, size, and effects, triggered by form field value changes and after update events.
learn how to shorten vba code by using with end with to set multiple properties of a single control, reducing repetitive text value references and improving readability in forms.
Learn to assign values to data-bound and unbound controls on an Access form using VBA, including text boxes, combo boxes, check boxes, and list boxes, with date handling.
Open and filter Microsoft Access forms with the open form command, naming forms and controls, handling on-click events, and configuring view, data mode, and optional parameters to display specific records.
Open the sold items form with VBA and apply a dynamic where clause to filter by quantity greater than one, concatenating textbox input for item titles with like and wildcards.
Learn to add a consistent close button in design mode, place it top-right, and wire an on click event to close the active form, with prompts for saving changes.
Master sql basics in access, including select queries, joins, where filters, and order by, plus update, insert, delete, and make table actions, with design view and vba integration.
Convert access action queries to VBA code and execute update statements to raise item prices by 2 percent, while suppressing the 'are you sure' prompt in a single procedure.
learn to suppress warnings when running action queries in VBA to update item prices, then turn warnings back on after the change.
Learn to build sql statements in variables by incrementally concatenating snippets, using conditional where clauses, proper string delimiters, and then run the variable as an action query to update records.
Swap the SQL that feeds a listbox or combo box using VBA to dynamically change the record source, filtering in-stock items and updating the list on double-click.
Learn to delete a table with VBA by checking existence, closing if open, and looping through current database tables to remove the target.
Learn to add data to a Microsoft Access table with VBA, using a form with three fields to insert records into the special offers table.
Load data into a recordset from a select query, then open and populate it with an ActiveX data objects connection to the current Access project, configuring cursor and lock options.
Learn to reference fields in a recordset by index or field name, extract values from the current record, and understand zero-based indexing in VBA with Access.
Learn to connect and create a recordset from an Access database, pull data, and navigate rows with move first, move next, move previous, and move last.
Close recordsets and ADODB connections after manipulating data to prevent locks and memory leaks, and tidy up by setting objects to nothing in VBA.
Create a form to search item titles and generate discounted offers by selecting matching records, calculating new prices, and inserting them into the special offers table with expiry date.
Learn to use DCount in Access VBA to count records with criteria, such as items on sale, and update form fields after a combo box change.
Explore the message box in Access using the MsgBox statement and function, display prompts and titles, offer button options, and capture user responses with a variable and if statements.
Explore customizing the MsgBox in Access: choose button sets, set the default button, show icons, enable multi-line text, and toggle between application and system modal behavior.
Learn to respond to a message box in Visual Basic for Microsoft Access by checking the returned result with if statements and vb constants like vbOK, vbCancel, vbYes, and vbNo.
Turn a form into a modal dialog box to prompt user input, then customize auto center, caption, and navigation settings for a focused interaction.
Create a modal dialog box in access to offer report options, with ok and cancel buttons, and wire actions to open reports in preview or print.
Populate a combo box with a dynamic list of reports by looping through the current project, building a name string, and setting the row source as a value list.
Apply a onload loop in VBA to populate the combo box by filtering out reports whose names include 'sample' with InStr.
Use the combo box to list printable reports and print the selected one via a button, opening a preview or printing; if none is selected, show 'Please select the report'.
Detect the right mouse click in a Visual Basic for Microsoft Access form by handling mouse down, reading button, shift, ctrl, and x/y coordinates, and displaying results.
Learn how combo box and list box properties control user input in Access, including row source types such as value list, table, or query.
Configure access form controls with VBA by loading a list box as a field list and populating a combo box with current table names on form load, excluding system tables.
Reference combo box fields across forms in a Microsoft Access VBA project, refreshing master and related items from another form while ensuring the target form is loaded.
Develop a list box search in Access using a cloned recordset and bookmarks to jump to the selected item on double-click, showing only the item title.
Explore built-in Visual Basic for Microsoft Access functions, use the expression builder to browse categories like text and math, and test functions in the Immediate Window.
Create a public function in a standard module via the vba editor to compute age from a birth date, then test it and use it in access.
Discover how to build a custom VBA proper case function that preserves McDonald capitalization, using left, mid, and UCase to clean mixed-case names.
Explore the three error types in Visual Basic: compile, logical, and runtime errors; learn how syntax, editor feedback, and debugging help identify and fix them.
Learn to diagnose logical errors in Access VBA using Debug.Print to display SQL and variable values in the Immediate window, test in the editor, and remove debug lines.
Place and manage breakpoints to halt execution, inspect variables via the locals and immediate windows, and step through code in Access to diagnose logical errors.
Learn to trap runtime errors in Visual Basic for Access with on error goto, display a user friendly message including the error number and description, and log if needed.
Customize error messages in Access by mapping error numbers to targeted messages. Use on error and error goto to handle common failures in report output and file saves.
In this software training course from InfiniteSkills, you will learn how to use Visual Basic with Microsoft Access. Knowing how to use Visual Basic with Microsoft Access gives you greater control of your Access forms and design.
You will start with an introduction to VBA and the VBA editor, how to navigate and use the tools available to you to write VBA code. You will explore variables and constants, functions, sub routines, arrays and other VBA constructs. This video based training will teach you to use VBA for data manipulation, create and use recordsets, controlling objects, create and use dialog and message boxes, debugging, and creating error messages. Finally, you will learn to protect your VBA programs.
By the completion of this training video, you will be comfortable with using Visual Basic for Access to exert greater control over your Microsoft Access forms and databases. Working Files are included to allow you to work alongside the author in this video tutorial.