1

I'm trying to get rid of the menu bar on my MS Access 2016 database, and only have the user able to see and use the running forms when the database is opened. Please see the picture below:

Access Database with Menu bar

Access Database with Menu bar

How to I go about this?

Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
MGS
  • 456
  • 1
  • 9
  • 24

1 Answers1

2

The following code will hide ribbon (menu bar).

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

Write above code on Startup form Load event. You can also hide Navigation Pane (Left bar showing tables, forms, reports etc) by calling following lines

 Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
 Call DoCmd.RunCommand(acCmdWindowHide)

So, the full code with error handling will be

On Error GoTo ErrHandler
    'Hide ribbon of access window
    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    'select the navigation pange
    Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
    'hide the selected object
    Call DoCmd.RunCommand(acCmdWindowHide)

Exit Sub
ErrHandler:
MsgBox Err.Description, vbCritical, "Error"
Harun24hr
  • 30,391
  • 4
  • 21
  • 36
  • handy tip, thanks Harun24HR, how would you then re-show the tables,forms and reports ? – mattpm Mar 30 '20 at 23:51
  • 1
    I have also codes to show navigation pane. I will give it. Now writing from mobile phone. When I will sit on my laptop then will post. – Harun24hr Mar 31 '20 at 03:15
  • @mattpm Looks like you could have an answer to your question if you'd turn it into an actual question. Keep in mind that new users do not have the commenting privilege and hence can only answer to actual questions. – Yunnosch Jul 26 '20 at 05:51
  • It doesn't look like mattpm ever asked this question, so I did, here: https://stackoverflow.com/questions/64252577/how-would-i-programmatically-show-items-hidden-on-startup – BWhite Oct 07 '20 at 21:30