Everyone learns best by doing, so to learn the basics of creating a class module, you'll create one. The class module will model a classroom at a school. You'll see this example throughout the chapter, showing the different parts of a class module and how to model its relationships with other classes.
The easiest way to add a new class module to your project is to press Alt+F11 to open the Visual Basic Editor. Then, in the Visual Basic designer window, select Insert Class Module. You can also right-click anywhere in the Project Explorer and select Insert Class Module from the context menu. In addition, you can also create a class module from within Access by selecting Class Module under the Macro split button in the Other group in the Ribbon's Create tab.
VBA opens a new class module and adds a reference to it in the Project Explorer. Copy the clsClassroom code into the module as shown in Figure 13-3. That's it! You've created your first class module!
All things have names, and class modules are no different. The name you give a class module, ...