Access™ 2007 VBA Programmer's Reference
by Teresa Hennig, Rob Cooper, Geoffrey Griffith, Armen Stein
10.1. VBA Basics
Before you dive into the wonderful world of forms, take a minute to review the following table, which shows the concepts that are fundamental to working with VBA.
| Concept | Definition | Examples |
|---|---|---|
| Object | An entity that can be manipulated with code | Form, Report, TextBox, ComboBox, CommandButton, DoCmd, Debug |
| Method | Any intrinsic (built-in) functionality already assigned to an object | Form.Requery, Report.Print, TextBox.SetFocus, ComboBox.Dropdown, DoCmd.OpenForm, Debug.Print |
| Event | An action associated to an object that executes when triggered by the user | Form.Open, Report.NoData, TextBox.AfterUpdate, ComboBox.NotInList, CommandButton.Click |
| Property | An attribute of an object that defines its characteristics (such as size, color, or screen location) or an aspect of its behavior (such as whether it is hidden) | Form.BackColor, TextBox.ControlSource, ComboBox.RowSource, CommandButton.Picture, Report.Recordsource |
10.1.1. Properties
Forms have properties and so do the controls on a form. Although there are a few properties that can only be read or set in VBA, the majority of an object's properties are listed on the Property Sheet. The main four categories of properties are format, data, event, and other. The needs of the customer and users will dictate which of these properties you set and when. Setting the properties in the Property Sheet may be all that is needed for some; however, the majority of your forms will have some kind of programmatic interaction with the user. Being able to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access