I have a Switchboard form which runs on startup and have chosen to ‘Hide Navigation Pane fo’r the current database. I would like a ‘for advanced users’ button on the Switchboard form to close the form, leaving the database open, and re-display the navigation Pane?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Modifying Access 2007 Switchboard form
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Modifying Access 2007 Switchboard form
- This topic has 17 replies, 4 voices, and was last updated 13 years, 2 months ago.
Viewing 8 reply threadsAuthorReplies-
RetiredGeek
AskWoody_MVPMarch 29, 2012 at 3:24 pm #1326838David,
Here’s some code that will get the trick done.
I’d recommend you assign a Shortcut Key to the HideNavPaneShowSwitchboard() routine if not both although you could modify the switchboard code to run the other one. :cheers:Code:Public Sub CloseSwitchBoardShowNavPane() DoCmd.SelectObject acTable, , True Forms![switchboard].Visible = False End Sub Public Function HideNavPaneShowSwitchboard() Forms![switchboard].Visible = True DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide End Function
-
davpol
AskWoody Plus
-
RetiredGeek
AskWoody_MVPMarch 30, 2012 at 8:50 am #1326915David,
You are correct. Make sure you create a new module to paste the code into. :cheers:
davpol
AskWoody PlusMarch 30, 2012 at 10:15 am #1326930Well, I’m getting into more problems than I thought. Firstly, a question on your sub “CloseSwitchBoardShowNavPane(). The second line is easy to understand, it hides the Switchboard, but does the first line show the Nav Pane?
Next Question is that having created a new module with the first sub in it, I cannot figure out how to attach it to a button in aSwitchboard Manager page. With other macros I have created, and which are listed in the Nav Pane, i.e. to run a Query, I have used the Switchboard Manager “Run Macro” option. This sub does not appear in the drop-down list of macros. I have tried in the Access “Create Macro” screen to attach this sub using “Run Macro”, “Run Code”, and “Run Command”, but cannot seem to find a way to get at this sub. Assistance for the mentally lacking greatly appreciated!RetiredGeek
AskWoody_MVPMarch 30, 2012 at 12:26 pm #1326943David,
Sorry I didn’t test this further.
First, the code runs correctly if executed from the VBE.
Second, you do have to declare the Subs as Public Sub ….. to call them from a Switchboard.If attached to the Switchboard via the RunCode option I get the error:
30490-AccessError
I even get this error on a simple procedure to display a message!
I know I have done this successfully in Access 2003 but can’t lay my hands on the code right now. I’ll get back when I find out what is going on. Perhaps while I’m looking someone else will offer some advice. :cheers:Update: Ok I got it sorted.
1. Make sure DO NOT include the () after the function/sub name in the Switchboard function name box!
2. You’ll have to assign a shortcut key to the function to reshow the Switchboard and Hide the NavPane. :cheers:-
davpol
AskWoody PlusMarch 30, 2012 at 1:02 pm #1326946 -
RetiredGeek
AskWoody_MVPMarch 30, 2012 at 1:12 pm #1326950David,
Just put Public in front of Sub, e.g. Public Sub routinename() :cheers:
FYI: I’ve adjusted the original code post to reflect this. -
davpol
AskWoody Plus
-
-
RetiredGeek
AskWoody_MVPMarch 30, 2012 at 1:10 pm #1326949Hey All,
I’ve been googling and reading and I still can’t figure out how to simply assign a keyboard shortcut to run a VBA routine in Access 2010. This was a piece of cake in 2003 with AutoKeys macro. HELP! A tutorial w/pictures would be useful as all the things I’ve found the text steps don’t follow through. :cheers:
-
WSjohnhutchison
AskWoody LoungerMarch 30, 2012 at 3:18 pm #1326964Hey All,
I’ve been googling and reading and I still can’t figure out how to simply assign a keyboard shortcut to run a VBA routine in Access 2010. This was a piece of cake in 2003 with AutoKeys macro.
I am not aware of anything changing with this from 2003. I still just use an AutoKeys macro like I used to. (But I never use accdb format. Does that affect things?)
WSruirib
AskWoody LoungerRetiredGeek
AskWoody_MVPMarch 30, 2012 at 6:24 pm #1326974John,
Thanks I didn’t know about the SubMacro thingy but your picture made it clear.
I had to make one other change and that was to make the HideNavPaneShowSwitchboard routine a Function as the Macro didn’t like it being a Sub {FYI: I modified the original code post to reflect this}.Public Function HideNavPaneShowSwitchboard()
Now all works as I think the OP wanted it to. :cheers:
Switchboard Setup:
30492-SwitchboardSetup
Switchboard View:
30493-SwitchboardView
AutoKeys Setup:
30494-AutoKeys
Also note that unlike Switchboard the Macro setup requires the () after the Function name!Two additional things you might want to consider:
1. The 1st time the Switchboard is displayed the Navigation Pane is still visible, so you probably need to code it’s invocation to hide the Nav Pane.
2. If F12 is pressed before the Switchboard has been displayed it will error out. What is need is a check to see if the Switchboard is loaded before trying to make it visible and if not loaded then load it.
-
davpol
AskWoody Plus
RetiredGeek
AskWoody_MVPMarch 30, 2012 at 6:45 pm #1326976David,
Glad you got it sorted. I got curious so I worked some more and here’s a version of the second routine that checks to see if the Switchboard is loaded and loads it if not. So pressing the hot key {F12 is my case} works every time.
Code:'Code to hide the navigation pane and display the switchboard in Access 2007-2010 Public Function HideNavPaneShowSwitchboard() If CurrentProject.AllForms("Switchboard").IsLoaded Then Forms![switchboard].Visible = True Else DoCmd.OpenForm "Switchboard", acNormal End If DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide End Function
:cheers:
-
davpol
AskWoody PlusMarch 30, 2012 at 7:35 pm #1326979I have tested your new macro – it is close. My Access normaly opens with Switchboard showing and Nav Pane hidden (I have hidden it in Current database options), so what I am looking for is:
1 Close Switchboard
2 Display Nav PaneYour new macro closes the Nav Pane and leaves the Switchboard visible according to my tests.
RetiredGeek
AskWoody_MVPMarch 31, 2012 at 8:12 am #1327015David,
The First of the two macros: CloseSwitchBoardShowNavPane() does this if you attach it to a Switchboard item using the RunCode option in the Switchboard Manager. Isn’t this what you wanted or do you also want to run this one from a key combination? :cheers:
Update:
Ok I’ve explored some more and I’ve come up with this:
Code:'Code to Toggle Navigation Pane and Switchboard in Access 2007-2010 'e.g. Switchboard on Navigation Pane off & visa versa. Public Function HideShowNavPaneSwitchboard() If CurrentProject.AllForms("Switchboard").IsLoaded Then If Forms![switchboard].Visible Then DoCmd.SelectObject acTable, , True Forms![switchboard].Visible = False Else DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide Forms![switchboard].Visible = True End If Else 'Not Loaded DoCmd.SelectObject acTable, , True DoCmd.OpenForm "Switchboard", acNormal DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide End If End Function
Attach the above code to the AutoKey of your choice and it handles all situations except the closing of the Switchboard manually using the X (close box). To handle that go into the code of the Switchboard in the VBE and modify the Form_Unload event as follows:
Code:Private Sub Form_Unload(Cancel As Integer) DoCmd.SelectObject acTable, , True End Sub
You should now have all the bases covered. I hope 😆 :cheers:
-
davpol
AskWoody Plus
Viewing 8 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
1 hour, 53 minutes ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
5 hours, 33 minutes ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
2 hours, 51 minutes ago -
System Restore and Updates Paused
by
veteran
8 hours, 3 minutes ago -
Windows 10/11 clock app
by
Kathy Stevens
2 hours, 5 minutes ago -
Turn off right-click draw
by
Charles Billow
11 hours, 17 minutes ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
14 hours, 48 minutes ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
3 hours, 52 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
16 hours, 25 minutes ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
8 hours, 27 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
22 hours, 27 minutes ago -
KB5060842 Issue (Minor)
by
AC641
1 day, 3 hours ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
1 day, 5 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
4 hours, 10 minutes ago -
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
1 day, 18 hours ago -
June 2025 updates are out
by
Susan Bradley
6 hours, 24 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
2 days, 8 hours ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
1 day, 18 hours ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
2 days, 11 hours ago -
Windows 11 Insider Preview build 26120.4250 (24H2) released to BETA
by
joep517
2 days, 11 hours ago -
Install Office 365 Outlook classic on new Win11 machine
by
WSrcull999
2 days, 11 hours ago -
win 10 to win 11 with cpu/mb replacement
by
aquatarkus
2 days, 3 hours ago -
re-install Windows Security
by
CWBillow
2 days, 14 hours ago -
WWDC 2025 Recap: All of Apple’s NEW Features in 10 Minutes!
by
Alex5723
2 days, 18 hours ago -
macOS Tahoe 26
by
Alex5723
2 days, 12 hours ago -
Migrating from win10 to win11, instructions coming?
by
astro46
3 hours, 15 minutes ago -
Device Eligibility for Apple 2026 Operating Systems due this Fall
by
PKCano
2 days, 3 hours ago -
Recommended watching : Mountainhead movie
by
Alex5723
2 days, 3 hours ago -
End of support for Windows 10
by
Old enough to know better
2 hours, 40 minutes ago -
What goes on inside an LLM
by
Michael Covington
3 hours, 37 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.