Access 2007 - Custom Ribbon - How to Add Objects

J

JoshuaZ

I had to package an access front-end containing forms and reports to run
using the Access 2007 runtime environment. Because this strips out the
default ribbon and takes away the navigation pane, i wanted to add the form
and report links to my new custom ribbon.
I sucessfully added my custom ribbon by creating a USysRibbons table and
adding the appropriate XML to form a ribbon, tab, and group, but I can't find
any documentation on how to create a button to link to the forms/reports. I
ideally want two groups in my tab, one for reports, one for forms and a
button for each report and form.
Can anyone point me in the right direction?
Thank you.
 
M

Maurice

You could take a look here: www.accessribbon.de

It might be an option to create one basic ribbon with default functionality
and specify specific functionality in additional ribbons. You can than assign
each ribbon to each specific form or report. That way when the report is
opened the user will only see that specific ribbon and when they close the
report they will see the default ribbon again.

You set the default ribbon under access options under the office button ->
Current database. Each ribbon you create should be added in the usysribbon
table you've created. Every ribbon is a new record with it's own xml. These
are the ribbons you can specify in your forms and reports.

View form properties / report properties and look for [Ribbon Name] under
tab Other.
How you reference the actions is very well explained on the site as
mentioned above.

hth
 
J

JoshuaZ

Yes, I've been to that website but it hasn't helped. I was looking for
explicit code to add to the xml the form/report objects. I had previously
tried going to the properties->other and selecting the ribbon. My custom
ribbon is in the dropdown and I select it. I save, close and re-open the
database, but the forms and reports still don't appear on the ribbon.
 
M

Maurice

Joshua,

Could you post your xml which you've already created in your usystable. That
way we can take a look at it. I assume you want to have a number of buttons
on your own created ribbon and be able to activate the forms and reports when
clicking on that button right?
 
J

JoshuaZ

Yes, that's what I want to do....
Here is the current XML:
There's also a dynamicMenu in there which I was attempting to use to
dynamically list all the database objects, but it wasn't populating the
dropdown, you can ignore that.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabCreate" visible="false" />
<tab id="dbCustomTab" label="A Custom Tab" visible="true">
<group id="dbCustomGroup" label="A Custom Group">
<control idMso="Paste" label="Built-in Paste" enabled="true"/>
<dynamicMenu id="dynObjectList" label="Open Objects"
getContent="OnGetObjectList" invalidateContentOnDrop="true" size="large"
imageMso="EditListItems"/> </group>
</tab>
<tab id="forms" label="Forms" visible="true"><group
id="grpContactForms" label="Contact Forms"></group>
</tab>
<tab id="reportTab" label="Reports" visible="true"><group
id="grpContactReports" label="Contact Reports"></group>
</tab>
</tabs>
</ribbon>
</customUI>
 
M

Maurice

Ok Joshua, here we go...

First i've taken a look at your xml. I see that you do want the default
ribbon to be visible right? In that case the two tabs you are referring to
are being placed after the last tab.

In your xml i've added the code you need to add to open the forms...


'-> In this part i've added some xmlcode. Find this section in your xml and
replace it with this piece... (after you've compared it with yours)

'-----------------------------------------------------

<tab id="forms" label="Forms" visible="true">
<group id="grpContactForms" label="Contact Forms">
<button id ="cmdOpenContactsForm" label="Open Contacts"
imageMso="ShowDetailsPage" supertip="click here to show contacs" size="large"
onAction="Ribbon.Contacts"/>
</group>
</tab>

'------------------------------------------------------

This is the first part. Save the USysRibbons table

Now create a macro called "Ribbon" (without the quotes ofcourse) with the
following settings:

1. Macroname "Contacts" (without the quotes) '- If you don't see this column
click the button [Macronames] in the ribbon
2. Action "OpenForm"

In the action arguments at the bottom of your screen choose the form to be
opened when you click on this button....

3. Save the macro and call it "Ribbon"

Explanation: the onAction within the xml searches for the macro called
"Ribbon" and within this macro it will look for the macroname "Contacts".


So feel free to change the lot to your desire...

Copy a second set to create a tab with a group and a button for your report.
Within the macro reference the report you want to open.

if you don't succeed let me know. Be sure to know that xml is case sensitive!

hth
 
J

JoshuaZ

That worked like a charm! Thank you so much.

Maurice said:
Ok Joshua, here we go...

First i've taken a look at your xml. I see that you do want the default
ribbon to be visible right? In that case the two tabs you are referring to
are being placed after the last tab.

In your xml i've added the code you need to add to open the forms...


'-> In this part i've added some xmlcode. Find this section in your xml and
replace it with this piece... (after you've compared it with yours)

'-----------------------------------------------------

<tab id="forms" label="Forms" visible="true">
<group id="grpContactForms" label="Contact Forms">
<button id ="cmdOpenContactsForm" label="Open Contacts"
imageMso="ShowDetailsPage" supertip="click here to show contacs" size="large"
onAction="Ribbon.Contacts"/>
</group>
</tab>

'------------------------------------------------------

This is the first part. Save the USysRibbons table

Now create a macro called "Ribbon" (without the quotes ofcourse) with the
following settings:

1. Macroname "Contacts" (without the quotes) '- If you don't see this column
click the button [Macronames] in the ribbon
2. Action "OpenForm"

In the action arguments at the bottom of your screen choose the form to be
opened when you click on this button....

3. Save the macro and call it "Ribbon"

Explanation: the onAction within the xml searches for the macro called
"Ribbon" and within this macro it will look for the macroname "Contacts".


So feel free to change the lot to your desire...

Copy a second set to create a tab with a group and a button for your report.
Within the macro reference the report you want to open.

if you don't succeed let me know. Be sure to know that xml is case sensitive!

hth
--
Maurice Ausum


JoshuaZ said:
Yes, that's what I want to do....
Here is the current XML:
There's also a dynamicMenu in there which I was attempting to use to
dynamically list all the database objects, but it wasn't populating the
dropdown, you can ignore that.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabCreate" visible="false" />
<tab id="dbCustomTab" label="A Custom Tab" visible="true">
<group id="dbCustomGroup" label="A Custom Group">
<control idMso="Paste" label="Built-in Paste" enabled="true"/>
<dynamicMenu id="dynObjectList" label="Open Objects"
getContent="OnGetObjectList" invalidateContentOnDrop="true" size="large"
imageMso="EditListItems"/> </group>
</tab>
<tab id="forms" label="Forms" visible="true"><group
id="grpContactForms" label="Contact Forms"></group>
</tab>
<tab id="reportTab" label="Reports" visible="true"><group
id="grpContactReports" label="Contact Reports"></group>
</tab>
</tabs>
</ribbon>
</customUI>
 
M

Maurice

Glad to hear you've got it working ;-)
--
Maurice Ausum


JoshuaZ said:
That worked like a charm! Thank you so much.

Maurice said:
Ok Joshua, here we go...

First i've taken a look at your xml. I see that you do want the default
ribbon to be visible right? In that case the two tabs you are referring to
are being placed after the last tab.

In your xml i've added the code you need to add to open the forms...


'-> In this part i've added some xmlcode. Find this section in your xml and
replace it with this piece... (after you've compared it with yours)

'-----------------------------------------------------

<tab id="forms" label="Forms" visible="true">
<group id="grpContactForms" label="Contact Forms">
<button id ="cmdOpenContactsForm" label="Open Contacts"
imageMso="ShowDetailsPage" supertip="click here to show contacs" size="large"
onAction="Ribbon.Contacts"/>
</group>
</tab>

'------------------------------------------------------

This is the first part. Save the USysRibbons table

Now create a macro called "Ribbon" (without the quotes ofcourse) with the
following settings:

1. Macroname "Contacts" (without the quotes) '- If you don't see this column
click the button [Macronames] in the ribbon
2. Action "OpenForm"

In the action arguments at the bottom of your screen choose the form to be
opened when you click on this button....

3. Save the macro and call it "Ribbon"

Explanation: the onAction within the xml searches for the macro called
"Ribbon" and within this macro it will look for the macroname "Contacts".


So feel free to change the lot to your desire...

Copy a second set to create a tab with a group and a button for your report.
Within the macro reference the report you want to open.

if you don't succeed let me know. Be sure to know that xml is case sensitive!

hth
--
Maurice Ausum


JoshuaZ said:
Yes, that's what I want to do....
Here is the current XML:
There's also a dynamicMenu in there which I was attempting to use to
dynamically list all the database objects, but it wasn't populating the
dropdown, you can ignore that.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabCreate" visible="false" />
<tab id="dbCustomTab" label="A Custom Tab" visible="true">
<group id="dbCustomGroup" label="A Custom Group">
<control idMso="Paste" label="Built-in Paste" enabled="true"/>
<dynamicMenu id="dynObjectList" label="Open Objects"
getContent="OnGetObjectList" invalidateContentOnDrop="true" size="large"
imageMso="EditListItems"/> </group>
</tab>
<tab id="forms" label="Forms" visible="true"><group
id="grpContactForms" label="Contact Forms"></group>
</tab>
<tab id="reportTab" label="Reports" visible="true"><group
id="grpContactReports" label="Contact Reports"></group>
</tab>
</tabs>
</ribbon>
</customUI>

:

Joshua,

Could you post your xml which you've already created in your usystable. That
way we can take a look at it. I assume you want to have a number of buttons
on your own created ribbon and be able to activate the forms and reports when
clicking on that button right?
--
Maurice Ausum


:

Yes, I've been to that website but it hasn't helped. I was looking for
explicit code to add to the xml the form/report objects. I had previously
tried going to the properties->other and selecting the ribbon. My custom
ribbon is in the dropdown and I select it. I save, close and re-open the
database, but the forms and reports still don't appear on the ribbon.
 

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