If your needs are more sophisticated, however, you can use Visual Basic to create, control, and manage all of the different types of objects in a Microsoft Access database. This chapter explains how to program with objects in Visual Basic. As you've seen in earlier chapters of this book, you can produce powerful applications in Microsoft Access without programming. However, when you need a more sophisticated application, writing Visual Basic code gives you a greater degree of control over what your application does. When you program in Visual Basic, you work with objects that correspond to different aspects of your database.
Collections are sets of objects of the same type.
Programming with objects and collections gives you added flexibility in that you can design your application to respond to user actions and input in a customized way. Visual Basic provides objects that give you more flexibility in programming, such as the Debug object and the Err object. Microsoft Office provides objects that you can use to customize the interface of your application, such as the CommandBar and FileSearch objects. Many of the objects that you work with in Visual Basic correspond to specific parts of your Microsoft Access database. For example, the Microsoft Access Form and Report objects correspond to your forms and reports, while the DAO TableDef and QueryDef objects correspond to your tables and queries.