Results 1 to 6 of 6
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046

    Ribbon is hidden only every other time when I open DB (need to always hide it)

    Hello:



    I have a fundamental question... upon opening a DB, I *always* want to hide the RIBBON. I have added 2 lines of code where the 1st line, apparently, does not hide the ribbon (thus, it is currently commented out). Alternatively, the 2nd line appears to be working; however, the hiding/displaying of the ribbon alternates each time when I open the DB.

    Code:
    Private Sub Form_Load()
    
        'DoCmd.ShowToolbar "Ribbon", acToolbarNo
        CommandBars.ExecuteMso "MinimizeRibbon"
    
    End Sub
    That is, ...
    1. Open DB for the first time... the ribbon is hidden.
    2. Open DB for the second time... ribbon is displayed.
    3. Open DB for the third time... the ribbon is hidden again.
    etc. etc.

    What code should be added/modified so that I always hide the ribbon and/or toolbar (unless I open the DB using the by-pass key)?

    Thank you,
    Tom

    P.S. And, oh by the way, I only want the hiding of the ribbon/toolbar be applied to this particular DB... not every time I open up any other ACCDB file. That is, I just noticed that the hiding of the ribbon (this sample file) also hides the ribbon on a completely different DB. I don't want that!
    Attached Thumbnails Attached Thumbnails RibbonDisplay.jpg  
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    The second line acts as a toggle. It minimizes the ribbon if its full height and vice versa...so no use to you.

    Using the commented out line works every time for me. Or at least it minimizes the ribbon so only the 3 menu items are visible.
    Or did you want to hide those as well?
    Anyway, try removing your Customized Toolbar from the Menu Bar in Access Options. It appears to be superfluous
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    isladogs -- thank you for the feedback. Copy on the toggle... I deleted that line.

    WRT to the minimized ribbon, I was hoping that I won't see "File | Add-Ins | Tell me what... " either.

    Also, as suggested, I set the menu bar = "(default)" under the Navigation Option. Still, this particular DB still displays the ribbon (well, only the minimized version).

    Any idea as to how I could completely hide it for this ACCDB only?

    Thanks,
    Tom

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Easy to do. You were almost there ...

    You either need to create your own blank ribbon using "StartFromScratch=True"
    OR you need to ENABLE Allow Built-In Toolbars in Access Options

    Click image for larger version. 

Name:	Capture.PNG 
Views:	12 
Size:	33.7 KB 
ID:	48360

    Doing that will allow the line DoCmd.ShowToolbar "Ribbon", acToolbarNo to completely hide the ribbon

    I've included my module modRibbon which includes these items HideRibbon, ShowRibbon, ToggleRibbonState & IsRibbonMinimized.
    You may find them useful

    If you are going to do any serious development work such as hiding parts of the application interface, I recommend you read two of my web articles and look at the accompanying example apps:
    Control Application Interface (isladogs.co.uk)
    Improve Access Security 2 (isladogs.co.uk)
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Colin:

    Awesome!!! That works beautifully!

    Thank you for sending the version that also includes your module... 'very helpful.

    Also, I appreciate the link to the 2 web articles of yours. 'Much obliged.

    Cheers,
    Tom

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    For info, the Allow Built-In Toolbars option is normally not available.
    It only appears when you create that property (as you did to use your customised menu).

    See this article for more info: AllowBuiltInToolbars Property (microsoft.com)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. MS Access / VBA - Test if Ribbon/toolbars are hidden
    By ironfelix717 in forum Programming
    Replies: 7
    Last Post: 11-22-2018, 05:18 AM
  2. Hide label on report if field is hidden
    By boboivan in forum Access
    Replies: 2
    Last Post: 02-07-2016, 08:21 AM
  3. Ribbon Hide
    By msaccessdev in forum Programming
    Replies: 2
    Last Post: 10-27-2014, 12:13 PM
  4. Replies: 1
    Last Post: 05-04-2014, 09:05 PM
  5. Open form only, hide the ribbon bar.
    By kcmiuser in forum Access
    Replies: 3
    Last Post: 05-22-2013, 02:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums