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

VBA - Accessing Access

By , About.com Guide

5 of 10

Coding the Access Example

Create a Table in Access

Create a Table in Access

Since this is an introduction to VBA, and not Access, the example here is the a very simple Access 2000 VBA application. We're going to use an Access object that simply calls old Access macro language instructions ... which are seriously out of date today but are still used by the Microsoft Access 2000 Wizards anyway.

Our Access VBA sample application will again be a combination application with Word being thrown into the mix along with Access. We're going to take a favorite verse from a poem by Lewis Carroll (of "Alice in Wonderland" fame) called, "The Walrus and the Carpenter" and copy it, line by line, into an Access database from a Word document. While this may not be a glowing business application, the basic ideas certain could be used in one. For example, saving comments from documents sent in by customers in a database. Besides, if you're a fan of Lewis Carroll as I am, sorting the lines of his poems randomly could make them make more sense.

To start our appplication, first create a blank Access database. Click New to create a single table with just a key field and a memo field in Design View.

As noted earlier, Access VBA code can be in a variety of different modules. We're going to put all of ours in an Access Form. So Select Form to create it. This time, we use the Wizard so we can connect it to our database more easily. It doesn't matter what style or background you select. Click Modify the Form's Design before clicking Finish on the last dialog.

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.