Compartilhar via


Working with Microsoft Access Objects

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Working with Microsoft Access objects primarily means working with Form, Report, and DataAccessPage objects and the controls they contain. You can use these powerful Access objects to format and display data and allow the user to add or edit data in a database. In addition, Access exposes many other objects you can use to work with your Access application; among the most important are the CurrentProject, CurrentData, CodeProject, CodeData, Screen, and DoCmd objects and the Modules and References collections. This section presents an overview of how to work with Access objects by using VBA.

Note   You can view the entire Access object model in the . You can also use the Object Browser and Microsoft Access Visual Basic Reference Help to learn more about individual objects, properties, methods, and events. For more information about using VBA to work with an Office application's object model, see Chapter 4, "Understanding Office Objects and Object Models."

Tables and relationships, the data in tables, and queries are managed and maintained by a database engine. For .mdb-type databases, Access uses the Microsoft Jet database engine. For .adp-type databases, Access uses the Microsoft SQL Server database engine or any other ActiveX Data Objects (ADO) data source. You programmatically work with tables, data in tables, or queries by using ADO or Data Access Objects (DAO). For information about using ADO and DAO to work with data in Office applications, see the chapters in Part 3, "Working with Data in Office Solutions."

Working with the Access Developer Solutions Sample Database

The coding techniques discussed in this section, along with many other techniques, are demonstrated and documented in the Developer Solutions sample database (Solutions9.mdb) and its accompanying Help file (Solutn80.hlp). You can find this database and Help file in the ODETools\V9\Samples\OPG\Samples\CH05 subfolder on the Office 2000 Developer CD-ROM.

The Developer Solutions sample database, along with some of the code samples used in this section, depends on the existence of the Northwind Traders sample database (Northwind.mdb) that is installed with Microsoft Access 2000. The Northwind Traders sample database is installed in the C:\Program Files\Microsoft Office\Office\Samples subfolder by default.