Access Cannot Run the macro or callback function: Access 2013

I have a database here with the following xml loaded into the system table, USysRibbons.  I keep getting an error:

Microsoft Access cannot run the macro or callback function 'MyToogleButtonCallbackAction'

This is a sample db taken from:

http://www.accessribbon.de/en/?Downloads:1

I'm using Access 2013.

Below is the xml entry and macro code

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="MyTab" label="My Tab">
        <group id="MyGroup" label="My Group">

          <labelControl id="myLabel1" label="Sample:" />
          <labelControl id="myLabel2" label="Toogle Buttons" />

          <toggleButton id="MyToogleButton1" size="large" label="Large Toggle Button" imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton2" size="normal" label="Small Toggle Button" imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton3" size="normal"  imageMso="HappyFace"
            onAction="MyToogleButtonCallbackOnAction"/>
          <toggleButton id="MyToogleButton4" size="normal" label="Small Toggle Button"
            onAction="MyToogleButtonCallbackOnAction"/>

        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Open in new window


macro

Option Compare Database
Option Explicit

Sub CallbackCut(control As IRibbonControl, ByRef bolCancel As Boolean)
    MsgBox "Cut"
    bolCancel = True
End Sub

Sub CallbackCopy(control As IRibbonControl, ByRef bolCancel As Boolean)
    MsgBox "Copy"
    bolCancel = True
End Sub

Public Sub MyToogleButtonCallbackOnAction(control As IRibbonControl)
    MsgBox "test"
End Sub

Open in new window

SampleRibbon1.accdb
sterlingalstonAsked:
Who is Participating?
 
sterlingalstonAuthor Commented:
No worries all.  Figured it out.

It's a very complex database and there were some setting issues.  

For the record, if you have a form that loads when the database opens and the form loads a custom tab when opened, then it may appear that your customUI is not working.

The solution: either disable the form from opening in your current database options (Access 2013)
-or-
change the RibbonName option in the form properties to select your customUI

else you will be frustrated, especially as a novice
0
 
sterlingalstonAuthor Commented:
Thanks, all!
0
 
Jeffrey CoachmanMIS LiasonCommented:
Do the other subs run?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
sterlingalstonAuthor Commented:
Unfortunately I don't know.  They definitely run without the iribbon control argument.
0
 
Jeffrey CoachmanMIS LiasonCommented:
How are you running that code?
0
 
sterlingalstonAuthor Commented:
the target macro is MyToogleButtonCallbackOnAction

i run it by clicking on any of the buttons in the My Tab
0
 
Jeffrey CoachmanMIS LiasonCommented:
Oh, OK, sorry I thought you were using VBA,...lets see if an Expert in macros will chime in...
0
 
sterlingalstonAuthor Commented:
Um... it is VBA, but it's called from the Ribbon. Like an Excel add-in, except this is through Access system table
0
 
Jeffrey CoachmanMIS LiasonCommented:
Then can you post a sample of this database for us to investigate?
0
 
sterlingalstonAuthor Commented:
The sample is attached in the post, right?
SampleRibbon1.accdb
0
 
Jeffrey CoachmanMIS LiasonCommented:
1. Still not seeing how or when that ribbon code is being executed...?
2. The query needs the table "tblAccessRibbControls"
0
 
sterlingalstonAuthor Commented:
Thanks for your help, but there is not ribbon code/ macro and there is no query.  It's a system table called USysRibbons.

This article explains in a few sentences:

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

Right-click the top of the Navigation Bar "All Access Objects" and select Navigation Options, check the Box that says "Show System Objects".

There you'll find the table with all the ribbon names and xml customui code. The ribbon that loads is ID 37
access-ribbon.JPG
0
 
sterlingalstonAuthor Commented:
Any updates?

I've managed to get this working in a separate DB, but this now isn't working in the DB I've imported this to.

I have a table called 'RibbonUItbl' and a macro called LoadRibbons that contains the method     Application.LoadCustomUI rs("RibbonName").Value, rs("RibbonXml").Value

Any ideas as to settings that prevent this from even appearing?  This is on a Windows 2008 server
0
 
Jeffrey CoachmanMIS LiasonCommented:
Sorry, I though I posted here saying that I could not recreate this here at work.
0
 
sterlingalstonAuthor Commented:
this fixed the issue
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.