MSAccess: Hiding Navigation Pane, and Menu Bar Using VBAccess
Asked Answered
L

2

5

Is there a way to hide the Navigation Pane, and Menu Bar on launch using MSAccess VB? Point is to remove "distractions" from users using MSAccess solution.

Fig A: Hiding the Navigation Pane and Menu Bar

enter image description here

Lacerate answered 28/7, 2021 at 3:29 Comment(0)
C
7

Option 1

One easy way is to rename the *.accdb to *.accdr.

Then it will be opened in runtime mode without ribbon bar and navigation pane.

Option 2

Call the database by full command line of Microsoft Access and the database and the command line parameter /runtime, then it also will be opened in runtime mode.

Example:

"c:\Program Files (x86)\Microsoft Office\Office15\msaccess.exe" "c:\data\yourDatabase.accdb" /runtime

(the path of Microsoft Access varies regarding your installation of Access (msi or c2r, x86 or x64, version of access, custom installation folder...)

Option 3

You can hide them by code:

Consist answered 28/7, 2021 at 5:30 Comment(2)
The runtime mode is genius - this definitely works for me as well. Thanks a million!Lacerate
Option 1 worked perfectly and is totally simple to implement. Thanks @AHeyne!Medick
S
2

Personally I use below codes to hide navigation pane & ribbon to my databases. You can also try-

Private Sub Form_Load()
On Error GoTo HarunErrHandler
    
'******************* Hide Ribbon and Navigation Pane ***************************

    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
    Call DoCmd.RunCommand(acCmdWindowHide)

'*******************************************************************************

Exit Sub
HarunErrHandler:
MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbInformation, "Error"
End Sub

If you need to show them again then use below codes.

'******************* Show Ribbon and Navigation Pane ***************************

    DoCmd.ShowToolbar "Ribbon", acToolbarYes
    Call DoCmd.SelectObject(acTable, , True)

'*******************************************************************************
Screwed answered 28/7, 2021 at 5:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.