Hide ribbon hides default menu, Why?

I am using an Autoexec to set the startup properties.  I want to hide ribbon, but at the same time display the default short menu.

Why does the menu disappear?

K

Option Compare Database
Option Explicit
Public Function Autoexec()
'Comments  : Runs on start up of database
'Developer : Karen F. Schaefer, DBA
'Created   : 03/27/2009
On Error GoTo Err_Autoexec

    SetStartupProperties

Exit_Autoexec:
    On Error Resume Next
    Exit Function

Err_Autoexec:
    Select Case Err.Number
        Case 0
            Resume Exit_Autoexec:
        Case Else
            MsgBox Err.Number & " " & Err.Description, vbExclamation, "Error in module basAutoexec - sub Autoexec"
            Resume Exit_Autoexec:
    End Select
End Function
Sub SetStartupProperties()
'Comments  : Runs on start up of database
'Developer : Karen F. Schaefer, DBA
'Created   : 03/27/2009
On Error GoTo Err_SetStartupProperties

Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
    DoCmd.SetWarnings False
    ChangeProperty "StartupShowDBWindow", DB_Boolean, False
    DoCmd.ShowToolbar "print Preview", acToolbarNo
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    Application.SetOption "Confirm Action Queries", False
    Application.SetOption "Confirm Document Deletions", False
    Application.SetOption "Confirm Record Changes", False
Exit_SetStartupProperties:
    On Error Resume Next
    Exit Sub

Err_SetStartupProperties:
    Select Case Err.Number
        Case 0
            Resume Exit_SetStartupProperties:
        Case Else
            MsgBox Err.Number & " " & Err.Description, vbExclamation, "Error in module basAutoexec - sub SetStartupProperties"
            Resume Exit_SetStartupProperties:
    End Select
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
 'Comments  : Runs on start up of database
'Developer : Karen F. Schaefer, DBA
'Created   : 6/9/2003 15:49
   Dim dbs As Object, prp As Variant
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then    ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, _
            varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function

Open in new window

Karen SchaeferBI ANALYSTAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
What version of Access?  With A2013, you can no longer live without the ribbon.  A2010 is the last version you still can hide the ribbon and present a menubar.

Jim.
Karen SchaeferBI ANALYSTAuthor Commented:
2007
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
So I guess I'm missing the boat here....what do you mean by "short menu".  Is this a menu bar that you've created or something else?

Is this something that was working and is now not, or your just using A2007 for the first time with some old code?

Jim.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Karen SchaeferBI ANALYSTAuthor Commented:
I was trying to hide the ribbon due to constraints on real estate.  but when I use the showtoolbar, the menu disappears all together.  I want to still display the default menu, not full menu.  What am I missing.  I currently am using the SendKEy F1.  is this the only way to use both options in 2007?

Karen
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<  is this the only way to use both options in 2007?>>

 Yes.    When you use Showtoolbar, your actually hiding the ribbon completely, which includes the menu bar as well.

 You can however as you noted use SendKeys to minimize the ribbon portion (only way to do it with A2007 that I'm aware of) and leave the menu bar.

 In A2010 and up you can do:

CommandBars.ExecuteMSO "MinimizeRibbon"

You can tell if the ribbon is currently minimized by checking it's height:

CommandBars.Item("Ribbon").Height

  If  80 or less, it's minimized.

  By the way, GREAT resource for ribbon stuff is Gunter's web site:

 www.accessribbon.de/en

Jim.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
I should correct myself on something; I referred to the tabs/text of the ribbon as a "menu bar".   It's really not and it's not something separate, which is why when you hide the ribbon, it disappears as well.  Old habits die hard and it's just the way I think of it.  Still haven't made the mental adjustment from earlier versions<g>

And note that when your minimizing the ribbon, what your really doing is invoking the auto hide feature.

With it minimized, if you click on one of the tabs, it will pop up.  However it does run over the top of anything displayed and will not push it down.

Jim.
Karen SchaeferBI ANALYSTAuthor Commented:
Thanks jim
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.