Hide Backstage Whilst Allowing Full Menus in Access 2016

When I have <button idMso="FileExit" visible="true"/> in my custom code, I receive an error stating that the control is not found.
I created a sample database...just a USysRibbons table and the options set as I have them currently. There are no other objects and no data, so all controls on the ribbon are grayed out, but you can see what the custom ribbon and File navigation pane look like with the custom ribbon xml applied. SHIFT+open is not disabled, if you need to add a data table.

Good luck!

P.S. I even tried opening as a runtime database. Although this takes care of the whole File menu thing, it also blows away my ability to export to Excel and Word...which, alas, defeats the purpose.
Just curious... I gave you two options to try (because I wasn't sure which one would work for you). Did you try the other one too?
 
Sorry for not mentioning it previously...I did try FileCloseDatabase, and it works, but it just gives the Close (not the Exit) control and leaves Access open.
 
Sorry for not mentioning it previously...I did try FileCloseDatabase, and it works, but it just gives the Close (not the Exit) control and leaves Access open.
Ah, that's probably why I used my own "exit" button. Have you looked in my demo to get that exit function?
 
Thanks.
I'm not sure what the problem is.

I created a simple table and form then set the form to open at startup so I could test your ribbon.
I unticked Allow Full Menus and the Home menu item in backstage is removed.
All the menu items in your Action and Output ribbons are still enabled and working (tested)

I tested with both your custom ribbons. Same result
I didn't make any changes to the ribbon XML
 

Attachments

Last edited:
Thanks.
I'm not sure what the problem is.

I created a simple table and form then set the form to open at startup so I could test your ribbon.
I unticked Allow Full Menus and the Home menu item in backstage is removed.
All the menu items in your Action and Output ribbons are still enabled and working (tested)

I tested with both your custom ribbons. Same result
I didn't make any changes to the ribbon XML
Hmmm...
I'm not sure why you are getting a different result. When I untick Allow Full Menus, the Home button in backstage is indeed removed, but so are the Excel, Word, and Email buttons in my custom Output tab on the ribbon.

Here is a screenshot of the Output tab with Allow Full Menus ticked:
1629296155864.png


And here is a screenshot of the Output tab with Allow Full Menus unticked:
1629295945958.png


Also, interestingly, I get errors in my custom ribbon code when I untick Allow Full Menus but it runs perfectly when Allow Full Menus is ticked.
 
Ah, that's probably why I used my own "exit" button. Have you looked in my demo to get that exit function?

I'm looking in your demo now. It's making me question whether I should just create the whole ribbon using VBA! It's so tempting, but my time and effort on this database is volunteered and I think I need to be ruthless with my boundaries. I did notice that you also created a custom Exit button in the ribbon...I may do that. Thank you!
 
There is another solution.
Hide the ribbon completely. Put all buttons with the required functionality directly on your form(s) e.g. in the form header/footer sections
 
I'm looking in your demo now. It's making me question whether I should just create the whole ribbon using VBA! It's so tempting, but my time and effort on this database is volunteered and I think I need to be ruthless with my boundaries. I did notice that you also created a custom Exit button in the ribbon...I may do that. Thank you!
Hi. I made some minor changes to @isladogs' demo. Please give it a try and let us know if it makes any difference. Cheers!
 

Attachments

Interestingly, I had tried EXACTLY the same idea with the visible & enabled items first on separate lines & then on the same line.
In each case, the effect was just to remove the two custom menus. No idea what I did differently

Anyway, I can confirm that your code change works for me...
(UPDATE:)
....but when I pasted the same code into the version I uploaded, the custom ribbons were again removed! Very odd.

Did you change anything else apart from those 3 ribbon XML lines?
 
Last edited:
There is another solution.
Hide the ribbon completely. Put all buttons with the required functionality directly on your form(s) e.g. in the form header/footer sections
It is definitely an idea. There are so many reports and some are just query datasheets...no way (that I know of anyway) to put buttons on those.
 
Hi. I made some minor changes to @isladogs' demo. Please give it a try and let us know if it makes any difference. Cheers!
So...upon downloading and opening the Sample_CR database, I do see that there is no Home button on the File navigation pane and my custom Output group has all the right icons; however, I receive an error when I click on the File tab. It cannot find any of the referenced backstage control ids (TabInfo, etc).
1629327828569.png
 
So...upon downloading and opening the Sample_CR database, I do see that there is no Home button on the File navigation pane and my custom Output group has all the right icons; however, I receive an error when I click on the File tab. It cannot find any of the referenced backstage control ids (TabInfo, etc).
View attachment 93727
Sorry, I only went so far as making sure you can see the buttons. I didn't click around. I'll check it out again later.
 
I get errors in my custom ribbon code when I untick Allow Full Menus but it runs perfectly when Allow Full Menus is ticked.
I do not know the XML ribbon stuff for Access well at all. But, I've done something similar in other programs. The code failures are likely an additional symptom of the same issue. I'm going to take a few higher view swings at this...

I feel that whatever is causing your icons to not show up is due to the code errors. So, the code to generate and/or use those buttons is failing and access is "solving" that problem by simply leaving out the failed buttons. If you tackle the errors, I suspect it will work correctly.

Since we have two broadly similar sample databases, one that works (isladogs) and one that doesn't (yours), that would lead me to believe the underlying database configuration and settings are different in some minor way that's leading to unexpected consequences. I would investigate whatever "loads" before the custom ribbon gets loaded by Access.
 

Users who are viewing this thread

Back
Top Bottom