Object model in
Visual Basic for Application (VBA)
Object-oriented environment
Concept |
Example in Access |
Object |
A field in a table A form A control on a form A query |
Properties |
Form controls have: color and font Fields have: data type, size |
Methods |
Closing an application |
Event |
A form control gets focus (contain the cursor) |
1. 2 types of objects
2. Each application has its object model
3. Referring to objects
e.g., Application.Presentations
e.g., Application.Presentations(“lecture6.ppt”).Slides(“slide3”) or Application.Presentations(1).Slides(3)
4. Referring to an object’s properties (characteristics) or methods (actions)
e.g., Application.Presentations.Count – returns the number of presentations currently open
e.g., Application.Presentations.Quit – instructs the application to close itself