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
-
Apk on iphone (Awaiting moderation)
by
Calluum
1 hour, 28 minutes ago -
Are Macs immune?
by
Susan Bradley
4 hours, 42 minutes ago -
HP Envy and the Function keys
by
CWBillow
5 hours, 11 minutes ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
6 hours, 35 minutes ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
6 hours, 52 minutes ago -
Unable to update to version 22h2
by
04om
7 hours, 11 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
14 hours, 20 minutes ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
14 hours, 23 minutes ago -
Very Quarrelsome Taskbar!
by
CWBillow
12 minutes ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
1 day, 3 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
16 hours, 4 minutes ago -
Is your battery draining?
by
Susan Bradley
9 hours, 11 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
6 hours, 11 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
1 day, 7 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
15 hours, 16 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
15 hours, 28 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
8 hours, 8 minutes ago -
National scam day
by
Susan Bradley
15 hours, 1 minute ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
11 hours, 10 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
2 days, 8 hours ago -
Tools to support internet discussions
by
Kathy Stevens
20 hours, 56 minutes ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
1 day, 23 hours ago -
AI is good sometimes
by
Susan Bradley
2 days, 15 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
2 days, 5 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
3 days, 15 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
3 days, 14 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
3 days, 18 hours ago -
Excessive security alerts
by
WSSebastian42
2 days, 9 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
4 days, 3 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
17 hours, 59 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.