Friday, 5 July 2013



What is a Module?

A module is a collection of declarations, statements, and procedures that are stored together as a unit. Modules are very similar to macros since they are objects that add functionality to the database. However, while you create macros in Access by selecting from a list of macro actions, VBA (Visual Basic for Applications) programming language is used for writing modules.
Modules generally belong to two types: class modules and standard modules. Class modules contain procedures that are associated with a specific form or report it is attached to. Standard modules contain general procedures that aren't associated with specific objects. Standard modules are listed under Modules in the Navigation Pane, whereas class modules are not.

Developing Programming Code

The programming language available in Access is Microsoft Visual Basic for Applications, which is nearly identical to Visual Basic 6.0 (VB6). VBA code can be stored in modules and code behind forms and reports. Modules can also be classes.
To manipulate data in tables and queries in VBA, two database access libraries of COM components are provided: the Data Access Objects (DAO), which is included in Access and Windows and evolved to ACE in Microsoft Access 2007 for the ACCDE database format, and ActiveX Data Objects (ADO). Beside DAO and ADO, developers can also use OLE DB and ODBC for developing native C/C++ programs for Access. For ADPs and the direct manipulation of SQL Server data, ADO is required. DAO is most appropriate for managing data in Access/Jet databases and the only way to manipulate the complex field types in ACCDB tables.


Post a Comment