Hide Navigation Pane. 2003 Compatable (1 Viewer)

RainLover

VIP From a land downunder
Local time
Tomorrow, 03:12
Joined
Jan 5, 2009
Messages
5,041
I have the following Code to hide Toolbars Menu etc.
Code:
Public Function RemoveCommandBars()
    Dim cmdBar As Object
 
    On Error Resume Next
            For Each cmdBar In CommandBars
            DoCmd.ShowToolbar cmdBar.Name, acToolbarNo
    Next cmdBar
 
End Function
This works fine and removes everything at the Top of the Screen Leaving only the Navigation Pane.

The following Code removes the Navigation Pane.
Code:
Function HideNavigationPane(ByRef cCalledFromForm As Form)
 
    If (cCalledFromForm.Modal = True) Then 'If the form is set to modal
        cCalledFromForm.Modal = False 'Disable modal
        DoCmd.NavigateTo "acNavigationCategoryObjectType" 'Select Navigation Pane
        DoCmd.RunCommand acCmdWindowHide 'Hide selected
        cCalledFromForm.Modal = True 'Enable modal
 
    Else 'Else not modal
        DoCmd.NavigateTo "acNavigationCategoryObjectType" 'Select Navigation Pane
        DoCmd.RunCommand acCmdWindowHide 'Hide selected
    End If
End Function

This works fine in A 2007 but Errors in 2003.

My problem is that I have a mixture of Machines. Some 2003 and Others 2007.

I need code to hide the Command Bars which I have without problem.

Next I need to hide the Navigation Pane.
The code I have is good for 2007 but Fails in 2003.

NavigateTo is not available in 2003.

I need a 2003 Database that also runs in 2007. I was thinking about checking the Version then if later than 2003 then run the code. If 2003 then do not run the code. I don't have the code to do this so if that is the solution does anyone have the Code to check the Version.

Hope I have explained myself correctly.
 

VilaRestal

';drop database master;--
Local time
Today, 18:12
Joined
Jun 8, 2011
Messages
1,046
Application.Version

Returns 12.0 for 2007 I believe
 

RainLover

VIP From a land downunder
Local time
Tomorrow, 03:12
Joined
Jan 5, 2009
Messages
5,041
VilaRestal

Thanks for that, but alas not the way to go.

The problem is that as I have a 2003 Database it will not Compile.

It fails on NavigateTo.

So I need to wait for other suggestions.

Thanks again.
 

Users who are viewing this thread

Top Bottom