Results 1 to 6 of 6
  1. #1
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19

    what is the code command for minimize ribbon ?

    As per the subject I would like to insert a line on the main form opening to reduce the multifunction bar, to avoid that every time I or whoever uses the created DB has to do it by right clicking the mouse ...

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Quote Originally Posted by Welshgasman View Post
    OK scusa,

    ho trovato:

    CommandBars.ExecuteMso "MinimizeRibbon"


  4. #4
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Quote Originally Posted by FER View Post
    OK scusa,

    ho trovato:

    CommandBars.ExecuteMso "MinimizeRibbon"

    And it doesn't always work, sometimes it works and sometimes it doesn't,
    regardless of whether it is inserted as a SUB in the mask or if a Function Public code is created in a module.

    Access does as it pleases...

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    What can I say
    It worked for me.
    If you use it when the ribbon is minimised, it will maximise the ribbon. It is a toggle command, so you need to take that into account.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Agree with @Welsshgasman
    That code line is used to toggle the ribbon state:

    Code:
    Public Function ToggleRibbonState()
    
    If GetAccessVersion > 12 Then
       'hide ribbon if visible & vice versa
       'doesn't work in Access 2007 (Access 12.0)
       CommandBars.ExecuteMso "MinimizeRibbon"
    End If
    
    End Function
    
    
    Function GetAccessVersion() As String
    
    'Gets Access version e.g. 12 for Access 2007, 14 for Access 2010 etc
    GetAccessVersion = Nz(CInt(SysCmd(acSysCmdAccessVer)), "None")
    
    End Function
    
    
    Public Function IsRibbonMinimized() As Boolean
    
        'Result: 0=normal (maximized), -1=autohide (minimized)
        IsRibbonMinimized = (CommandBars("Ribbon").Controls(1).Height < 100)
    
    End Function
    I also have code to show/completely hide both ribbon & menus at Manage Taskbar/Nav Pane/Ribbon
    For example:

    Code:
    Public Function HideRibbon()  
    
         'could run at startup using Autoexec
        'however this also hides the QAT which makes printing reports tricky
         DoCmd.ShowToolbar "Ribbon", acToolbarNo
    
    End Function
    As the article title indicates it also has code to manage the taskbar & navigation pane
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 5
    Last Post: 10-28-2021, 05:32 PM
  2. Code VBA for minimize application in Taskbar (Access)
    By ZakariaAadel in forum Programming
    Replies: 1
    Last Post: 11-14-2020, 07:38 AM
  3. Replies: 5
    Last Post: 07-29-2018, 09:09 AM
  4. Replies: 15
    Last Post: 04-11-2015, 08:15 AM
  5. NO minimize button in Email Code
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-03-2012, 08:11 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