Can use this such as:
DisplayNavPane True
or
DisplayNavPane False
Code:
Public Sub DisplayNavPane(IsVisible As Boolean)
'7/29/2009 DLT
Dim strTableName As String
On Error GoTo DisplayNavPaneError
'strTableName = "local_Parameters" 'could use a tablename, or a module acModule, etc
'but it runs OK using mSysObjects
strTableName = DLookup("Name", "mSysObjects", "[Type] = 1 AND [Flags] = 0")
DoCmd.SelectObject acTable, strTableName, True
If IsVisible = False Then
DoCmd.RunCommand acCmdWindowHide
End If
Exit Sub
DisplayNavPaneError:
If Err.Number = 2544 Then
'Get the name of the first table in the mSysObjects table
strTableName = DLookup("Name", "mSysObjects", "[Type] = 1 AND [Flags] = 0")
Resume
Else
MsgBox "Error encountered in DisplayNavPane subroutine!"
End If
End Sub