3 4
Toolbars and menu bars in some form have been part of Microsoft Access since its earliest versions, but the techniques used to customize them and create new ones have gone through several changes. Early versions of Access used macros to create menus and menu commands. The standard Microsoft Office Customize dialog box and customization through Microsoft Visual Basic for Applications (VBA) code were introduced in Access 97. In Access 2002, you can make certain modifications to menus and toolbars in the user interface, but other command bar modifications can be made only in VBA code.
In this chapter, you’ll learn how to customize the built-in Access menus and built-in toolbars using the Customize dialog box, how to create your own custom menus and toolbars, and how to create menus and toolbars in VBA code and add buttons or commands to them, including special toolbar buttons that can only be created in code.
Some Notes on Terminology
Access, like the other Office applications, includes three types of interface objects that offer choices of commands: toolbars with buttons, menu bars with menus offering a list of text selections, and shortcut menus that pop up when you right-click forms or controls. In early versions of Access, menus and toolbars were different types of objects, and menus were created by a special type of macro (menu-macros).
In Access 2002 (and for several earlier versions), however, both menus and toolbars are just two types of command bars. They’re created in the interface by using the Customize dialog box or in VBA code by using the CommandBars collection and the CommandBar object. The very different appearance and functionality of toolbars and menus depends on the properties specified for a command bar and on the types of controls placed on it as buttons or menu commands.
In the Access user interface, the term toolbar is often used for both toolbars and menu bars. For example, if you open the properties sheet for the Access menu bar from the Customize dialog box, its title is Toolbar Properties.
The buttons or menu commands you place on command bars can be set to be displayed as images, text, or both. Therefore, you can create menu bars with buttons displaying images, or toolbars with text-only buttons, or even toolbars with menus. The only real difference between toolbars and menu bars in the Access user interface is that menu bars have the Ask A Question box and toolbars don’t.
tip - Standardize the user interface
tip - Add controls to command bars