[AccessD] Toggle the Navigation Pane in A2010

Gary Kjos garykjos at gmail.com
Thu Oct 25 05:24:40 CDT 2012


Thanks for sharing Gustav.


On Thursday, October 25, 2012, Gustav Brock <gustav at cactus.dk> wrote:
> Hi all
>
> Sorry, wrong macro was included.
>
> /gustav
>
> ----
> Hi all
>
> A client requested the option to toggle the Navigation Pane in A2010 by
> pressing Ctrl+F2.
> Perhaps you may find it useful:
>
> <code>
> Public Function EnableNavigationPane(Optional ByVal varEnable As Variant)
As
> Boolean
>
> ' Set or toggle if the Navigation Pane should be visible or not.
> ' Requirement: At least one form must exist in the database.
> '
> ' 2012-10-24. Cactus Data ApS, CPH.
> '
> ' Can be used with AutoKeys macro to be toggled with key combination
Ctrl+F2
> '
> ' Import AutoKeys by saving the following lines as a text file.
> ' Remove leading single quotes.
> ' Run this command:
> '   LoadFromText acMacro, "AutoKeys", "d:\path\autokeys.txt"
>
> 'Version =196611
> 'PublishOption =1
> 'ColumnsShown =0
> 'Begin
> '    MacroName ="^{F2}"
> '    Action ="RunCode"
> '    Argument ="EnableNavigationPane()"
> 'End
> 'Begin
> '    Comment ="_AXL:<?xml version=\"1.0\" encoding=\"UTF-16\"
> standalone=\"no\"?>\015\012<UserI"
> '        "nterfaceMacro MinimumClientDesignVersion=\"14.0.0000.0000\"
> xmlns=\"http://schem"
> '        "as.microsoft.com/office/accessservices/2009/11/application\"
> xmlns:a=\"http://sc"
> '        "hemas.microsoft.com/office/acc"
> 'End
> 'Begin
> '    Comment ="_AXL:essservices/2009/11/forms\"><Statements/><Sub
> Name=\"^{F2}\"><Statements><A"
> '        "ction Name=\"RunCode\"><Argument
> Name=\"FunctionName\">EnableNavigationPane()</A"
> '        "rgument></Action></Statements></Sub></UserInterfaceMacro>"
> 'End
>
>
>     Static strForm      As String
>     Static booEnabled   As Boolean
>
>     On Error Resume Next
>
>     If strForm = "" Then
>         ' Find and store name of first form.
>         strForm = DBEngine(0)(0).Containers!Forms.Documents(0).Name
>     End If
>     If Not IsMissing(varEnable) Then
>         booEnabled = Not CBool(varEnable)
>     End If
>
>     DoCmd.SelectObject acForm, strForm, True
>     If booEnabled = True Then
>         DoCmd.RunCommand acCmdWindowHide
>     End If
>     booEnabled = Not booEnabled
>
>     EnableNavigationPane = booEnabled
>
> End Function
> </code>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

-- 
Gary Kjos
garykjos at gmail.com


More information about the AccessD mailing list