Link to home
Start Free TrialLog in
Avatar of Philip001
Philip001

asked on

Creating ribbons in Access 2010

I have created a ribbon in Access 2010 by adding XML to a table. The ribbons show fine.
What I wish to do is put some vba code behind the buttons as follows

But access does not recognise the IRibbonUI
I've check the object explorer but cannot find IRibbonUI there either
Please can you help me know how I get IRibbonUi to show?
Which object is it a part of?
'declaration
Public objRibbon As IRibbonUI


Public Sub OnRibbonLoad(objRib As IRibbonUI)

Set objRibbon = objRib

End Sub

'our callback for the SampleButton
Public Sub OnButtonPress(ctl As IRibbonControl)

If (ctl.ID = "SampleButton") Then

MsgBox ("You have just executed the OnButtonPress callback when clicking" _
& vbCrLf & "the Ribbon SampleButton!")

End If

End Sub
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Have you seen this resource for the Ribbon:

http://www.accessribbon.de/en/?Access_-_Ribbons:Callbacks

There is a utilty there (Ribbon creator) that is an EXCELLENT investment, but if you're just looking for answers there is a ton of info there as well.
Avatar of Philip001
Philip001

ASKER

Hi
Thanks for your information. I have already seen this site. I have copied the code but it is not recognised in the visual Basic editor. Do you know if I have to have a certain reference set for IRibbonUI to be recognised?
thanks so far
ASKER CERTIFIED SOLUTION
Avatar of Philip001
Philip001

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I found the answer