Ribbon callback error

  • Thread starter Thread starter RTY
  • Start date Start date
R

RTY

I am having a problem with getting the Callbacks to work on my ribbon. I
have a ribbon that displays and you can execute the buttons. However, the
callback functions aren’t working.
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabAddIns">
<group id="ResGroup" label="Resources">
<button id="btnResource" imageMso="HappyFace" size="large" label="Resource
Input" onAction="ResourceUsageInput" />
<button id="btnResPivot" imageMso="MeetingsWorkspace" size="large"
label="Resource Pivot" onAction="ResourceUsagePivot" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>


I get the infamous “Resource Usage can’t run the macro or callback function
‘ResourceUsageInputâ€. Make sure the macro or function exists and takes the
correct parameters."

Public Sub ResourceUsagePivot(control As IRibbonControl)
DoCmd.OpenForm "Resource Usage Pivot"
Exit Sub


This is the callback. It won’t compile. It is in a regular Module. I
looked at my references and I have the “Microsoft Access 12.0 Object Library,
Visual Basic for Application, OLE Automation, Microsoft Office 12.0 Access db
engine references all checked and active. I don’t know what I’m missing. I
thought I might have corrupted the 12.0 object library so I reinstalled
Access. The compile error is “User defined type – not defined. I’m new to
this and can’t find out what I done wrong or what I'm missing.
 
onAction="ResourceUsageInput"


try:

onAction="=ResourceUsageInput()"

Also, that function for a buttion should be somthng like:


Public Function Bt3()
' code here for button 1

MsgBox "code runs here for button3"

End Function

the xml to call the above public function is:


<button id="button1" label="Buttion1"
onAction="=Bt1()" supertip= "Big tool tip text here" />
 
Back
Top