Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


1026


One of the principles employed in Access ribbons is that there is virtually no limit to the number
of objects at each level of the ribbon hierarchy. This means that you can add virtually any number
of tabs to a custom ribbon. Obviously, too many tabs or too many groups can become a real prob-
lem for your users. Generally speaking, you should design your ribbons in a conservative manner,
including only the items at each level that your users actually need.

Getting Started with Access Ribbons


As mentioned before, creating and customizing ribbons is very different than working with
CommandBars in earlier versions of Access. Creating Access ribbons is, at a minimum, a five-step
process. Each of these steps is described in detail in the following sections. Later you’ll see many
more examples of these steps.

Step 1: Design the ribbon and build the XML
As with most database objects, the first step to creating a new Access ribbon is to design it carefully
on paper. If you are converting an existing toolbar or menu to an Access ribbon, you have a pretty
good idea of the controls and other items to add to the ribbon.

The XML document you create for your ribbon mirrors the design you’ve laid out. Perhaps the
most challenging aspect of composing the ribbons XML is visualizing how the ribbon will look,
based on the XML behind it. There are no visual cues in a ribbon XML document that hint at the
ribbon’s appearance when rendered in Access. Experience will be your best guide as you work
with ribbon customization, and sometimes trial and error is the only way to achieve a desired
objective.

As a final point, Access is extremely fussy about the XML used to compose ribbons. There is no
“parser” in Access that validates the XML as a ribbon is rendered. If an error exists in the XML doc-
ument, Access refuses to render the ribbon, or the ribbon will be missing elements defined in the
XML. Most often, the only way you know that an error exists in your ribbon XML code is that
Access loads the default ribbon instead of your custom ribbon.

Inevitably, ribbon development in Access requires a number of back-and-forth cycles in which you
modify the XML, transfer it to Access, and view the results. You have no real way of really knowing
how well your XML will work as a ribbon specification until Access renders the ribbon on the
screen.

The section titled, “The Basic Ribbon XML,” later in this chapter, describes the fundamental XML
statements required by Access ribbons.

See the section titled, “Using Visual Web Developer” later in this chapter to see how to use the
Express edition to compose the XML driving your Access ribbons. Also, several sections in this
chapter discuss the XML necessary to define ribbons, tabs, groups, and controls.
Free download pdf