DI Management Home > Microsoft Access Classes

Using class modules to create your own objects

This set of pages on using classes in Microsoft Access was originally written in the late 20th century as a training aid for people on a project we were doing using Access 97. The complete series was never completed and it has not been updated for years, but it is still more-or-less valid and some people find it useful.

In June 2014 we removed the pages as part of a site update, but we immediately got complaints and requests to put it back up. So we have. Thanks in particular to Petar Mrkic for his encouragement.

If you use VBA to make your Microsoft Access programs more intelligent, and especially if you use unbound forms, you will almost certainly find the convenience of class modules to be well worth the extra initial effort.

The following tips are a simple introduction in how to use the Class Modules and making a start in doing your own object-oriented programming.

A simple example
Read only properties
Making it do something
Linking to a database table
Saving to the database
Editing and deleting objects

The tutorials assume you are reasonably familiar with using VBA in an Access application.

Download the sample database file (zipped 85 KB)

This code was originally written in Access 97, and we include that version (classes-acc97.mdb) for those like us who still use it (yes, we do!). The version classes-acc2000plus.mdb seems to work fine with Access 2000, 2003 and 2007.

 |  Next >>

Contact us

To contact us or comment on this page, please send us a message.

This page first published circa 2000. Last updated 11 June 2014. Reformatted for HTML5 on 21 June 2020.