Summary

In this chapter you learned how to create a VB 6 COM add-in that works with Access 2007, placing buttons in the Toolbar Commands group of the Add-Ins tab of the Ribbon. If you have a VB 6 add-in created in a previous version of Office, you can modify it slightly so that it will work in Access 2007, reusing your code. If, on the other hand, you want to learn a new programming language so you can put groups and buttons on specific tabs of the Ribbon, see the next two chapters for working with Ribbon XML and Visual Studio 2005 add-ins.

Most of the sample databases for earlier chapters included objects from the Access 2007 Backup database, used to make incrementally numbered database backups. In order to use this feature in a database, you need to import several objects from Access 2007 Backup.accdb into the current database, and set a reference to the Microsoft Scripting Runtime library, which is a nuisance. It would be much more convenient to just have backup available in all your Access databases, say from a menu command.

An Access add-in will do just that, encapsulating a set of database objects and code into a single package that is available to all Access databases. In this chapter I use as an example an Access add-in (Extras 2007.accda, that includes an enhanced version of the Backup code (from basBackup in Access 2007 Backup.accdb), with some enhancements: a setup form for specifying the backup folder; and a set of objects and code that let you print out lists of tables or queries, and their fields, excluding those with user-specified prefixes — very handy for when you need to know which fields are in which tables during database development, or for documenting the database structure.

The sample database for this chapter is Extras 2007.accda.

If you are attempting to install an add-in in Access 2007 running on Windows Vista, you may get the security warning shown in Figure 14-1. This is probably because you are not running Access as an administrator. To run Access as an administrator, right-click the MSACCESS.EXE file in the Office 12 subfolder under the Microsoft Office folder, and select "Run as administrator," then open an Access database and install the add-in. This is not a problem when installing add-ins for Access 2007 running on Windows XP.

IN THIS CHAPTER

Creating Access menu add-ins

Creating Access wizards

Creating Access property builders

Special considerations and troubleshooting for Access add-ins

0 0

Post a comment