How to reuse the Access 2007 ribbon buttons

  • Thread starter José António Silva
  • Start date
J

José António Silva

Is it possible to reuse the Access 2007 ribbon buttons in a new ribbon?
I know I can create a USysRibbons table to save some new ribbons. I know how
to define groups and buttons with XML. I know how to create VBA subroutines
to handle user clicks on these new ribbons. However:
1) Everything was easier if I can simply reuse some existing buttons and
groups, i.e., like in the Access 2003 command bars.
2) More important! I don’t know how to produce some “â€â€automaticâ€â€â€ Access
native behaviors. For example:
a. Disable the next record button, when we are in the last record.
b. Disable the previous record button, when we are in the first record.
c. Disable the new record button, when we are filling a new record.
d. …
All this behaviors avoid some run-time errors that, otherwise, I have to
check everywhere.
Thanks!
José António Silva
 
A

Albert D. Kallal

Yes, you can pull Individual buttons, or even poll groups:

<group idMso="GroupClipboard" />
<group idMso="GroupFindAccess" />
<group idMso="GroupSortAndFilter" />


The above is quite typcial of what you need (clipboard, find,
sorting/fitler).

Here is a custom reprot ribbon of mine:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="MyReport" label="Report">

<group idMso="GroupPrintPreviewPrintAccess" />
<group idMso="GroupPageLayoutAccess" />
<group idMso="GroupZoom" />
<group idMso="GroupPrintPreviewClosePreview" />

</tab>
</tabs>
</ribbon>
</customUI>

So you're actually free to grab individual buttons, or individual groups, in
fact after awhile you build up a few of these libraries of examples, you'll
actually find this a lot easier than the old system.

To find out what is the idMso of a group (or buttion) you go:

Simply hit the office button-->access options

then choose customize from the left side

Now when you have a your mouse over any option in the list, the very last
part of that hover tip is the actual "id" you use.
a. Disable the next record button, when we are in the last record.
b. Disable the previous record button, when we are in the first record.
c. Disable the new record button, when we are filling a new record.
d. .
All this behaviors avoid some run-time errors that, otherwise, I have to
check everywhere.

Golly, are you sure you don't want use the built in navigation buttons for
this? to enable, and disabled buttons requires you to use callbacks, and
it's a bit tricky.

Customizing the Office Fluent User Interface in Access 2007
http://msdn.microsoft.com/en-us/library/bb187398.aspx

and

http://www.access-freak.com/tutorials.html#Tutorial05
 
J

José António Silva

It was exactly what I'm looking for. Many thanks!
José António Silva
 
P

pddxxx

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top