Chapter 4. Creating Your Own Objects
Now that you understand basic object-oriented programming concepts, you can turn your attention to the topic of creating your own objects. This chapter will provide a brief summary of what you have learned so far and will then teach you why and how to create custom class modules with associated properties, methods, and events. It will also cover how to extend existing objects, such as forms or controls, by adding custom properties, methods, and events. As with most other chapters, you can download the database containing the code for this chapter from Wrox.com
.
Using Class Modules to Create Your Own Objects
As you have already learned, an object refers to all the things that make up your database, including forms, reports, and controls. By encapsulating code into objects, you make programs easier to maintain and more easily re-usable. You also have learned that objects can have properties, methods, and events. Properties are characteristics of the object, and methods are actions you take upon the object. Events are triggered when a user or application performs an action. These objects, which you worked with in Chapter 3, were created using class modules, although you did not see the proprietary source code for the Access objects.
You may remember from Chapter 2 that a class module is only one of the two types of modules; the other type is a standard module. Standard modules are modules that contain procedures that are not associated with any particular ...
Get Beginning Access 2003 VBA now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.