Murray Brown
asked on
Access VBA - Hiding Navigation panes
Hi
I am using the following code to hide the navigation panes in an Access database on the load event of my main form.
One problem that I have is that without navigation how will I go in to see my Visual Basic code.
I only want to activate this code when I give it to a user. Am I going about things correctly here?
I am using the following code to hide the navigation panes in an Access database on the load event of my main form.
One problem that I have is that without navigation how will I go in to see my Visual Basic code.
I only want to activate this code when I give it to a user. Am I going about things correctly here?
Private Sub Form_Load()
Call oHide_Navigation(True)
End Sub
Sub oHide_Navigation(ByVal blnHide As Boolean)
On Error GoTo EH
If blnHide = True Then
'To hide the ribbon, add this code to your form's OnOpen event.
DoCmd.ShowToolbar "Ribbon", acToolbarNo
Else
'To restore it:
DoCmd.ShowToolbar "Ribbon", acToolbarYes
End If
If blnHide = True Then
'To Hide the Navigation pane via vba code, you can use:
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide
Else
'And to bring it back:
DoCmd.SelectObject acTable, "MSysObjects", True
End If
Exit Sub
EH:
MsgBox "There was an error trying to hide/show the Access navigation" & Err.Description & " nb5"
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER