Access is another one of the most popular hosting environments for VBA, so it's appropriate that our next example be an Access database.
One of the first things you might notice when you select Tools > Macro in Access is that the resulting menu doesn't have a Record New Macro ... option. The bottom line is that Access is too varied and complex for this to work. Consequently, you have to write your Access VBA programs without the running start that this tool gives you in Word or Excel. Record New Macro option is also missing in Outlook. Outlook and Access were also the last of the Office suite to get full VBA automation.
You shouldn't be surprised to discover that there are a number of other differences in the way you program VBA in Access versus the Word/Excel examples we saw previously. Another big difference is that Access almost requires you to add References to object libraries to your code to use it successfully. (In Word and Excel, if you don't use anything exceptthe hosting application, it's not necessary.) Access VBA will normally be written to take advantage one of a number of optional database object libraries including RDO, DAO, and ADO with helpers like ODBC thrown in for good measure. As Access guru Paul McFedries puts it, "You don't deal with 'documents' in Access. Instead you have a database 'container' that's filled with numerous other objects such as tables, forms, and reports."


