Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ribbon callback to a library routine

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I have a button on a ribbon. The onAction command is set to call a function that exists in an access database that I reference.
The xml code for the button looks like this:
<button id="123"
label="mylabel"
onAction="=MyLibraryRoutine('argument1')"
size="large"/>

The error I get is that my database can't find the function. However, if I copy the function from my library database to my current database, it works fine. I can also execute the function via debug's Immediate window (while it still exists in my library).

My question is, how do I call a library routine via the onAction command of a ribbon? That is, what is the syntax?
 
Nevermind...I decompiled and compacted and repaired both databases and that seemed to have cleared up the problem.
 
By the way.. in case you didn't arleady hear (assuming these are Access 2007 databses).. you can customize the Office 2010 ribbons without code - at least as far as new ribbons, what appears where, etc. [smile]
 
I guess I should have said New Groups.. or maybe New Tabs.. but the ribbon is just the ribbon, I guess. [spineyes]
 
kjv1611, how do you customize the Office 2010 ribbons without code? For example, suppose I want to open a form that exists in my Library (which is a database I reference) and I want the current form to be hidden while the user is accessing the library form. Upon exiting the library form, the hidden form is made visible.

Also, how do I add images to a button without coding it?
How do I populate a dynamic menu without code? Or a drop-down list box?

I'm in the process of upgrading my wizards that I use to create my forms and controls and the code behind them. My wizards also need to create my ribbons programmatically. So that's why I'm asking. For example, if dynamic menus can be updated without code, my wizard will need to create them like that.
 
For example, suppose I want to open a form that exists in my Library (which is a database I reference) and I want the current form to be hidden while the user is accessing the library form. Upon exiting the library form, the hidden form is made visible.
You're not talking about customizing the ribbon here, really.. you're talking about opening and closing individual forms or databases - totally different subject, unless I'm missing something.

On editing the image.... I just did it as a test..
1. right-click on any icon in the ribbon - maybe any spot, didn't try that much.
2. Click Customize the Ribbon
3. Add a new tab... it'll automatically add a new group to go with that new tab.
4. Right-click, select Rename on the new group
5. In the rename window, you can rename it AND you can apply whatever icon.
6. Then you can add individual items to the new group, and there, you can rename them same as the group (name and icon)

...My wizards also need to create my ribbons programmatically...
Well, there you go. You say you're WANTING to do it programatically. I didn't say it HAD to be done w/o programming, but that it CAN be done. [wink]
 
Sorry, I misunderstood what you said. I though I had missed something very obvious.

Another question...I've created several different custom ribbons. Some of the controls are built-in controls (i.e. next record, prev record, etc.) and some are custom (i.e. open specific library forms, etc.). The definitions of my ribbons are stored in the file USysRibbons. How do I get my custom ribbons to show up in the list of ribbons in the "Customize the Ribbon" dialog window?
 
Sorry. [reading] That's something I'll have to read up on myself to be any help. However, you might want to look through some tutorials online for dealing with the XML code behind the ribbon. There you might be able to find that particular solution. I've seen them, just haven't taken the time to dig into it any.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top