Level7Sensei
asked on
Adding Macros to the ribbon in MS Access using USysRibbons
I'm new to using xml, but not new to Access or VBA. I need to create a deployable ribbon that can be customized upon load based on the users role. I am creating this ribbon using a USysRibbons table to hold the XML code. I can add built-in controls no problem. Where I am stuck is adding controls that call saved macros or procedures. Below is code I'm testing with, but line 6 doesn't work. Any help is appreciated!
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="dbChecklists" label="zChecklists" visible="true">
<group id="dbRCL_Forms" label="Forms">
<control idMso="Macro: macRCL_Add" label="Add" enabled="true"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There are also third party tools available, such as Ribbon Creator, which make very short work of this.
ASKER
Still no luck. I changed line 6 to the following:
And I added a public procedure as you showed:
The XML part isn't being accepted. What am I missing? Thanks.
<button id="RCL_Add" label = "Add" onaction="btnAdd_RCL" enabled="true"/>
And I added a public procedure as you showed:
Public Sub btnAdd_RCL()
DoCmd.OpenForm "frmRCL_Add"
End Sub
The XML part isn't being accepted. What am I missing? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Interesting! I actually haven't tried the enabled property on a ribbon command button. I'll check it out tomorrow... Perhaps you need a similar property such as Locked (?)
ASKER
Primary failure was using the illegal switch of 'enabled="true"'.