- Local time
- Today, 11:06
- Aug 16, 2013
I'm using this code to show and hide the ribbon & navigation pane from within a form. I'm using a regular command button as a toggle. It works fine in normal daily use, but not always, after coming out of design mode. Sometimes the form I'm designing closes and sometimes the nav pane shows and the ribbon is hidden.
I'm sure that there is much more robust code out there to perform this common function. All suggestion will be much appreciated.
Private Sub CommandHIDE_Click() Static IsHidden As Boolean If IsHidden Then DoCmd.ShowToolbar "Ribbon", acToolbarYes DoCmd.SelectObject acTable, , True IsHidden = False Else DoCmd.ShowToolbar "Ribbon", acToolbarNo DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide IsHidden = True End If End Sub