Chapter 13 - Customizing Access Toolbars and Menus (Command Bars)

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


In the interest of preventing confusion, and to preserve a familiar Office-standard interface for your Access databases, you should stick with using graphics buttons for toolbars, menus for menu bars, and text selections for shortcut menus, with only a few exceptions for special cases.

tip - Add controls to command bars


You can see special controls such as drop-down lists on built-in Access toolbars. You can add these special controls to command bars only in VBA code; when you drag a command to a command bar in the user interface, it will appear as a standard button or menu command. See the section "Creating Custom Command Bars and Their Controls in Code," for information about adding special controls to command bars.



Microsoft Access Version 2002 Inside Out
Microsoft Access Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612838
EAN: 2147483647
Year: 2005
Pages: 172
Authors: Helen Feddema

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net