We learn best by doing, so to learn the basic techniques used to create a class module, this section is devoted to creating one you may find useful in your own projects.
To add a new class module to your project, press Alt+F11 from the database window to open a new standard module. Then from the Visual Basic Designer window, select Class Module from the Insert menu. You can also right-click anywhere in the Project Explorer and select Insert|Class Module from the context menu.
VBA opens a new class module and adds a reference to it in the Project Explorer. Copy the clsKennel code into the module, as shown in Figure 12-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, however, is the name that is shown in both the Project Explorer and the Object Browser, so it should be something relevant and meaningful. For a more in-depth discussion on naming objects, refer to section on Naming Objects, later in this chapter.
To name your class, display the Properties window by selecting it from the View menu, or by pressing F4. Then enter a name in the (Name) property. You might like to review Appendix G for object-naming conventions and prefixes.
You will ...