Disabled ribbon randomly shows up

bengiomanni

Registered User.
Local time
Today, 07:30
Joined
Mar 14, 2013
Messages
25
I have disabled the Ribbon using XML code in the USysRibbon table. Everything has worked fine, except that now when I click on two different tabs that exist on my form, the Form Tools Ribbon pops up with options to go to Layout, Design View, etc., and other options, too. I have two subforms on this tab, but neither one has a Ribbon Name set (I didn't even know how to do that when I made them) and I have no idea even where to look to see why this is happening. The Ribbon does not show at all on the other tabs like it is supposed to. It only shows when I click on my 3rd and 4th tabs, and then it disappears again when I click on other tabs. It's so weird.

Any information would be greatly appreciated.
 
If you would like to attach your DB I can take a look and see what my experience is.
 
I can't post the database because the information in it is confidential, but I actually discovered something after I posted it. When a subform is in datasheet view and it is current, it seems that this was actually overriding my XML code for the ribbon and showing the Datasheet group tools in the Ribbon. I found a setting in Options to disable layout changes for Datasheet view, but this did not help. Instead, I unchecked the box for "Allow full menus" in Options and this kept the ribbon from showing when I clicked on those datasheets. (Of course it messed up a custom ribbon icon I had that showed the full Print menu, but I didn't really need that one anyway so I changed it). I don't know if there is another answer, but I did at least find the source of the problem.
 
I can't post the database because the information in it is confidential, but I actually discovered something after I posted it. When a subform is in datasheet view and it is current, it seems that this was actually overriding my XML code for the ribbon and showing the Datasheet group tools in the Ribbon. I found a setting in Options to disable layout changes for Datasheet view, but this did not help. Instead, I unchecked the box for "Allow full menus" in Options and this kept the ribbon from showing when I clicked on those datasheets. (Of course it messed up a custom ribbon icon I had that showed the full Print menu, but I didn't really need that one anyway so I changed it). I don't know if there is another answer, but I did at least find the source of the problem.

It would be good if you could show us the callback functions for your custom ribbon, including OnLoad and OnLoadImage. I have not experienced issues that you describe with my custom ribbons.

Best,
Jiri
 
The only callback I have for the ribbon is for a ribbon named "Report" that is in the Ribbon Name for the one report I have in the database. I had no callbacks for the datasheet subforms at all. After I had the problem, I added my Main customized ribbon name to the Ribbon Name property of those datasheet subforms, but that didn't stop the problem (Main ribbon has StartfromScratch set to true so everything is hidden). Disabling "Allow full menus" in Options was the only thing that kept the ribbon from appearing.
 
The only callback I have for the ribbon is for a ribbon named "Report" that is in the Ribbon Name for the one report I have in the database. I had no callbacks for the datasheet subforms at all. After I had the problem, I added my Main customized ribbon name to the Ribbon Name property of those datasheet subforms, but that didn't stop the problem (Main ribbon has StartfromScratch set to true so everything is hidden). Disabling "Allow full menus" in Options was the only thing that kept the ribbon from appearing.

I would recommend you add an onLoad callback procedure and reference it in the custom UI XML statement (1st line) i.e. sth like
Code:
<customUI xmlns="[URL]http://schemas.microsoft.com/office/2006/01/customui[/URL]"
onLoad="LoadCUIRibbon">

Then in a VBA global module create the following:

Code:
Public objRibbon as IRibbonUI 
 
Public Sub LoadCUIRibbon(ribbon As IRibbonUI)
On Error Resume Next
'----------------------------------------------------------------------
'  objRibbon will be used to store current  ribbon for refresh
'-----------------------------------------------------------------------
Set objRibbon = ribbon
End Sub

This piece of code assures that Access has reference to the existing ribbon (even if empty) when you switch to a different ribbon. You can then force the reloading (and/or refreshing the dynamic controls of the ribbon) by executing the invalidate method, i.e. objRibbon.Invalidate

Try it !


Best,
Jiri
 
You can then force the reloading (and/or refreshing the dynamic controls of the ribbon) by executing the invalidate method, i.e. objRibbon.Invalidate

Sorry I never responded to this. My project work in Access is such that I am off and on with sometimes long delays in between. I don't understand your last sentence. How can I force the reloading, and when/where would I trigger that?
 

Users who are viewing this thread

Back
Top Bottom