You can use your favorite social network to register or link an existing account:
Or use your email address to register without a social network:
Sign in with these social networks:
Or enter your username and password
Forgot your password?
Yes, please link my existing account with for quick, secure access.
No, I would like to create a new account with my profile information.
I described the new Access UI in this post and this post way back in March. Now I'll run through how you program the ribbon UI using VBA. In a future post (we're still working out the content) I'll do another post on how to do the same thing using macros (so the app will run in disabled mode).
The ribbon UI presents a ton of new flexibility for us creating Access and for you building apps on top of Access that wasn't there before. As described in the posts on the ribbons, there are a lot of new control types that can be placed in the ribbon, and there's much more flexibility about how they are presented. The downside to this additional flexibility is that the ribbons are more complex to create than the old command bars. Building ribbons isn't beyond the reach of any successful Access user today, but it will take some more work. The upside is that the end product can be significantly better.
Here's an example of an application with a customized ribbon UI:
(Click image to enlarge)
The app has a rich set of controls, including a dropdown to let different users log on:
And of course after each user logs on, you can fire code to both update the contents of the ribbon itself and to take actions inside the application. Here is an example of the changes to the ribbon itself:
The application can have multiple tabs, just as Access does, and the user switches between them just as in the regular Access ribbons. Here's the Form ribbon:
In addition, custom ribbons can use the full range of controls available in Access. Here's an example of a dropdown button on the Reports tab:
And an alternate split button presentation for the same data:
Controls on the ribbons can how have "Super Tooltips" (not sure if that is the real name?). These are extra large tooltips containing more, and richer information than the command bar style tooltips, but that launch in just the same way.
There are 5 steps to customizing the ribbons:
The ribbon definition is a simple XML file and can be easily created in any text editor, but if you're using Microsoft Visual Basic.NET 2005 Express Edition or Microsoft Visual Web Developer 2005 Express Edition, you can get IntelliSense for your code. Visual Web Developer looks something like this:
You can point it at the custom ribbon schema at http://schemas.microsoft.com/office/2006/01/customui and VWD should pick up the correct file, which is called customUI.xsd. Alternately, you can download the file from http://officeblogs.net/UI/customUI.xsd.
This enables VWD to provide type-ahead IntelliSense for the correct ribbon xml.
You can see the XML file for the sample application we're building by clicking here. The contents of the file are:
Next, you need to write the routines that are called by the ribbon when an action is performed. Here's what to keep in mind when writing these routines:
In many cases, you can use a single routine for many events. For example, you might have a single subroutine that handles opening forms in your database using button controls in the ribbon. The tag attribute in the button can be used to store the name of the form, and the generic routine simply opens that form name. For example, such a routine might look like this:
Public Sub onOpenForm(control as IRibbonControl)
' Open the form which is specified in the tag attribute
' Cached copy of the RibbonUI. Used to invalidate the ribbon to
' refresh controls.
Public gobjRibbon As IRibbonUI
' customUI onLoad event handler
Public Sub onRibbonLoad(ribbon As IRibbonUI)
' cache a copy of the Ribbon so we can refresh later
Set gobjRibbon = ribbon
' Then, to refresh the entire ribbon, call:
You can look at the macros in this example database to get a better idea of the code to write.
Simply create a table in your database called USysRibbons. This table should have 2 columns:
The table should looks something like this:
Now simple create a record for each ribbon you'd like to create in the table above. Note that this is already done in the image above.
Next, you go to the Access Options dialog and under Toolbar Options, choose the ribbon for the selected object. Again, you can see these settings most easily in the attached database.
Here are a few general things to remember:
For additional resources take a look at these sites:
The next post will be the first of several drilling down into using Access in conjunction with Windows SharePoint Services.
I create a table in an Access Project with 2 fields, VarChar & Text (because in sql server there is no text & memo)... My project does't show the customized ribbons...
What can I do?