A Custom Ribbon for Access Applications

A custom ribbon in an Access application can serve two purposes.  I can be part of a strategy to keep user from accidentally making design changes to an application you have built.  It can also add a nice bit of "polish" to an application, giving it a more professional look by providing easy access to features provided by the application.

Creating the ribbon and making it display

In this video we will:

  1. Create a table to hold our ribbon XML
  2. Use an XML editor to build some very basic ribbon XML
  3. Build a form to display and edit the ribbon XML we load into the XML table
  4. Copy our XML into the form/table
  5. Choose which ribbon to display

Code listing

How to include and hide Microsoft’s built-in ribbon controls in our custom ribbon

In this video we will:

  1. Learn how to find the names of Microsoft's built-in ribbon controls
  2. Use an XML editor to add several built-in ribbon controls to our custom ribbon
  3. Learn to hide a built-in ribbon control

Code listing

 

How to include Microsoft’s built-in images on our custom ribbons

Adding images to the controls can give an indication of the functionality provided by the control to compliment the label.

In this video we will:

  1. Learn how to find the names of Microsoft's built-in images
  2. Use an XML editor to add several built-in images to our custom ribbon
  3. Look at how the ribbon re-sizes the images based on control and image size

Code listing

 

 

The VBA that allows our ribbon to “make something happen”

Adding images to the controls can give an indication of the functionality provided by the control to compliment the label.

In this video we will:

  1. Write VBA to make ribbon buttons open forms
  2. Write VBA to enable and disable ribbon buttons based on form usage
  3. Add the necessary attributes to the ribbon XML to interact with this VBA

Code listing

 

 

Adding custom images and labels

In this video we will:

  1. Discuss the types of images the ribbon can handle
  2. Write the XML to get a custom image
  3. Write VBA to return an image from our file system
  4. Write XML to place a label on the ribbon and retrieve text for the label
  5. Write VBA to return a user name for the label
  6. Write XML and VBA to decide whether to show or hide a button

Code listing

 

 

Contextual Tabbing!

In this video we will:

  1. Discuss several methods of showing and hiding tabs based on user interaction
  2. Show how to add several contextual tabs to your custom ribbon

Code listing

 

 

Load Data to and Get Input from the Ribbon

In this video we will:

  1. Load values to a dropdown box from a table
  2. Load default values to two editboxes
  3. Retrieve the user's selection from a dropdown box
  4. Retrieve the user's text entered into an editbox

Code listing

Examples of additional ribbon controls

 

Load custom images from an attachment field

In this video we will:

  1. Load images to a table in an attachment column
  2. Build a form to display the images in our new table
  3. Modify our GetImageCallback VBA to retrieve an image from this form

Code listing

 

 

Load custom images from an attachment field

Save to disk and load to ribbon from there

In this video we will:

  1. Load images to a table in an attachment column
  2. Modify our GetImageCallback VBA to retrieve an image via VBA and DAO
  3. Save the image to disk
  4. Load the picture to the ribbon from disk using the LoadPicture method.

Code listing