1. Home
  2. Computing & Technology
  3. Visual Basic

VBA - Accessing Access

By , About.com Guide

4 of 10

VBA in Access

Access - No "Record New Macro"

Access - No "Record New Macro"

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."

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB 6
  5. Learn VBA
  6. VBA - Accessing Access

©2009 About.com, a part of The New York Times Company.

All rights reserved.