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
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
One easy way is to rename the *.accdb
to *.accdr
.
Then it will be opened in runtime mode without ribbon bar and navigation pane.
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...)
You can hide them by code:
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)
'*******************************************************************************
© 2022 - 2024 — McMap. All rights reserved.