none
Hiding the ribbon in Access 2013 RRS feed

  • Question

  • Trying to hide the ribbon in Access using USysRibbons table.
    The most up to date discussion I found online (a preview of Access 2016 bible) includes this ribbon XML:

    <CustomUI xmlns="http://schemas.microsoft.com/office/2009/07/CustomUI">

    ....but it doesn't seem work in Access 2016.

    Is there a new namespace for Access 2016?

    Thanks in advance for any help.

    Saturday, May 27, 2017 2:24 PM

Answers

  • You could place the code in the on-load event of your startup form that you have set to "start".

    So the "one" line is placed inside of a code event. The "whole" code would look like this:

    Private Sub Form_Load()

       DoCmd.ShowToolbar "Ribbon", acToolbarNo
      
    End Sub

    Of course when you "edit" code for the forms event, the editor will place the Private Sub and End Sub parts for you automatic - so you don't actually type in that part of the code. So open your startup form in design mode, and then on the events tab select (click on) the on-load event. A  [...] button will appear. You click on that button, and choose build event. So you only do have to paste in the above one line of code.

    Regards,

    Regards,
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada

    • Marked as answer by NK-Bristol Saturday, June 3, 2017 10:46 AM
    Friday, June 2, 2017 2:55 AM
  • Hello Norman,

    >>I did load the Ribbon in Access Options and I do have error display turned on. The ribbon gets cleared, except for the File tab, but remains visible

    That is expected result because clicking the File tab takes you to the Microsoft Office Backstage view. Unfortunately, the backstage element doesnt support the attribute visible. So we are unable to hide the File in the ribbon. I think using ShowToolbar command to hide the whole ribbon might be the only solution.

    Besides, "<ribbon startFromScratch="true">" should be closed by "</ribbon>" , or just use "<ribbon startFromScratch="true"/>". 

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by NK-Bristol Sunday, June 11, 2017 8:36 AM
    Monday, June 5, 2017 2:45 AM
    Moderator

All replies

  • There are several ways to do this including the use of a ribbon.

    However most easy is to execute this one line of VBA in your start up code:

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    Regards,
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada

    Saturday, May 27, 2017 4:56 PM
  • Thanks Albert for your help. Do you mean literally the one line, i.e. no Function/EndFunction pair? And where is the "startup code" in which I will execute it?

    After those questions, I hardly need say that I am not an experienced VBA programmer, so I really would appreciate it if you spell your solution out for me.

    Thanks again,

    Norman

    Sunday, May 28, 2017 8:49 PM
  • Hi Norman,

    If you have a startup form or a default display form like a splash screen, then you can place the code Albert provided in its Open event.

    Just my 2 cents...

    Sunday, May 28, 2017 9:16 PM
  • Hello,

    >DoCmd.ShowToolbar "Ribbon", acToolbarNo

    The command would hide your ribbon like

    Is that what you want?

    >>Is there a new namespace for Access 2016?

    AFAIK, there is no new namespace for Access 2016.

    What XML do you use?

    Do you load the Ribbon in Access Options ->Current Database ->Ribbon and Toolbar Options

    I would suggest you check "Show add-in user interface errors" in Access Options ->Client Settings -> General-> Show add-in user interface errors. Then it would prompt the error in your XML when loading the ribbon.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 29, 2017 3:35 AM
    Moderator
  • USysRibbons works fine in 2016.

    That said, you need to include

      <ribbon startFromScratch="true">

    and of course set your ribbon to display at startup, thus hiding everything else.


    Daniel Pineault, 2010-2016 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Monday, May 29, 2017 12:38 PM
  • You could place the code in the on-load event of your startup form that you have set to "start".

    So the "one" line is placed inside of a code event. The "whole" code would look like this:

    Private Sub Form_Load()

       DoCmd.ShowToolbar "Ribbon", acToolbarNo
      
    End Sub

    Of course when you "edit" code for the forms event, the editor will place the Private Sub and End Sub parts for you automatic - so you don't actually type in that part of the code. So open your startup form in design mode, and then on the events tab select (click on) the on-load event. A  [...] button will appear. You click on that button, and choose build event. So you only do have to paste in the above one line of code.

    Regards,

    Regards,
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada

    • Marked as answer by NK-Bristol Saturday, June 3, 2017 10:46 AM
    Friday, June 2, 2017 2:55 AM
  • Hi Albert,

    Thanks for your very helpful response --- problem solved.

    I experimented with switching off the ribbon on Form_Load, restoring it on Form_Unload, and it works a treat.

    Thanks once again,

    Norman

    Saturday, June 3, 2017 10:52 AM
  • Hi Celeste,

    Thanks very much for your help. Following Albert's response, I implemented the VBA approach and it works fine, but I should like to get the XML solution working, too.

    I noticed, by the way, that I posted for 2013 but I actually have 2016 --- doubt that makes a great deal of difference --- or does it?

    The XML I use in USysRibbons is:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon startFromScratch="true"/>
    </customUI>

    I did load the Ribbon in Access Options and I do have error display turned on. The ribbon gets cleared, except for the File tab, but remains visible. Changing the second line to <ribbon startFromScratch="true"> raises a 0xC00CEE3B error message: "The name in the end tag of the element must match the element type in the start tag".

    If you can resolve this for me I'd be most grateful.

    Regards,

    Norman

    Sunday, June 4, 2017 7:57 PM
  • Hello Norman,

    >>I did load the Ribbon in Access Options and I do have error display turned on. The ribbon gets cleared, except for the File tab, but remains visible

    That is expected result because clicking the File tab takes you to the Microsoft Office Backstage view. Unfortunately, the backstage element doesnt support the attribute visible. So we are unable to hide the File in the ribbon. I think using ShowToolbar command to hide the whole ribbon might be the only solution.

    Besides, "<ribbon startFromScratch="true">" should be closed by "</ribbon>" , or just use "<ribbon startFromScratch="true"/>". 

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by NK-Bristol Sunday, June 11, 2017 8:36 AM
    Monday, June 5, 2017 2:45 AM
    Moderator