Forms & Reports:
Switchboard Form

Title: Jan's Illustrated Computer Literacy 101
Did you want: Working with Databases: Access 2007, 2010, 2013, 2016


Once you have a number of forms and reports, it would be nice to have a way to quickly get to the ones you use the most often. A switchboard form is just the thing. In fact, many commercial databases open with just a switchboard in view. This is very useful when most users are just going to use the database and not create new tables or forms or reports.

Our example database, Language Arts Classes, has a switchboard that opens other switchboard pages, which have buttons that open the most often used forms/reports.

Main Switchboard can have buttons that open other switchboard pages

Main Switchboard opens two switchboard pages
which have buttons for forms and reports


Where you are:
JegsWorks > Lessons > Databases

Before you start...

Project 1: Intro

Project 2: Access Basics

Project 3: Tables & Queries

Project 4: Forms & Reports Arrow: subtopic open
    Import/Export/LinkTo subtopics
    Designing FormsTo subtopics
    Designing ReportsTo subtopics
    Special Forms & Reports Arrow: subtopic open
    Icon: StepSwitchboard Form
    Icon: StepCustom Dialog
    Icon: StepLabel Wizard
    Icon: StepChart Wizard
    Icon: StepMultiple Columns
        Subform/Subreport
    Icon: StepSubforms
    Icon: StepSubreports
    Summary
    Quiz
    ExercisesTo subtopics


Search  
Glossary
  
Appendix



Switchboard Manager

Menu: Tools | Database Utilities | Switchboard ManagerAccess provides a special tool, Switchboard Manager, for creating and managing a switchboard form, which can have several switchboard pages. This is somewhat like the tab control for forms in that one object has several pages but only one page shows at a time. The example above has 3 pages - Main Switchboard, Forms Switchboard, and Reports Switchboard.

The command to open the Switchboard Manager is buried under  Tools | Database Utilities .
 

Switchboard Manager: step 1 - select page or create newThe first window in the Switchboard Manager shows a list of existing switchboard pages and has several buttons for actions you can perform on these pages.

  • New: Opens a window for creating a new switchboard page
  • Edit: Opens a window for making changes to the selected switchboard page
  • Delete: Deletes the selected switchboard page. This does not remove buttons on other pages that open the switchboard that you are deleting.
  • Make Default: Picks which page shows when you open the Switchboard form.
     

If you create several switchboard pages, you need to create an item on the main switchboard page for each of them. You cannot open the other switchboards any other way! All switchboard pages are part of a single object, which just looks like separate forms. Access is being tricky but helpful here!


Create a New Switchboard Page

Dialog: Create New - switchboard pageWhen you click the New button on the Switchboard Manager, a dialog appears for you to enter a name for the new switchboard page. The default name, New Switchboard Page, is uninspiring!
  Switchboard Manager: new page listedThe new page appears in the list in the Switchboard Manager. You are not automatically sent to edit the blank switchboard page that you just created! You must select the page and click on Edit so that you can add items to the new page.
 

You must also go to the default switchboard and create a button to open your new switchboard page. Surprisingly, this is not done automatically for you.
 


Add/Edit Items on a Switchboard Page

Switchboard Manager: Step 2 - EditWhen you select a switchboard page in the Switchboard Manager and click the Edit button, the Edit Switchboard Page window opens. This lists each of the items that are on the switchboard you are editing. (It will be blank if you just created the switchboard.)

Use the buttons to create new items, edit the existing ones, delete items, and rearrange the order of items (with the Move Up and Move Down buttons).

The Edit and New buttons open a different kind of window, Edit Switchboard Item.  There are three text boxes in this dialog.
 

Dialog: Edit Switchboard Item - View FormsText: What you want to see beside the button in the switchboard window. Be descriptive but short.
 

Dialog: Edit Switchboard Item - Command - Go to SwitchboardCommand: What should happen when the item is clicked.

There is a drop list of actions - Go to Switchboard, Open Form in Add Mode, Open Report, Exit Application, etc. If you can write a macro or code segment, you can do more than just open an existing form or report. You are limited only by your imagination and your coding skills!

Open Form in Add Mode opens the form directly to a blank form, ready for you to create a new record.
 

Edit Switchboard Item: select argumentsThe third text box provides the arguments for the command that you chose. So it depends on what you selected as the command! For example, if you choose Go to Switchboard, the third box is a drop list of the switchboards in the database.


Edit Switchboard Item: select different argumentsIf you choose Open Form in Add Mode or Open Form in Edit Mode, then the third text box shows a list of forms in the database.
 

Edit Switchboard Item: selected ExitIf you choose Exit Application, there is no third box at all. That command does not require any additional information.
 

Icon: TroubleChanges don't show after closing Switchboard Manager:
Cause:
The Switchboard form was open while you made changes.
Solution: Close and reopen the form or else switch to Form Design View and back to Form View to refresh the window.


Table for Switchboard

Table Datasheet View: Switchboard ItemsWhen you create a switchboard form, Access automatically creates a new table called Switchboard Items. This lists all of the items on all of the switchboard pages.

Do not edit this table directly or delete it or rename it. You will break your switchboard. Use the Switchboard Manager to make any changes.

  • SwitchboardID: Identifies which switchboard page the item is on.
  • ItemNumber: Sets the order of items on the page, where 0 is the item number of the page itself.
  • ItemText: What shows in the title bar of a page or beside the action button on the page.
  • Command: A code for the action that you selected in the Command text box.
  • Argument: A code or name of the object that you selected in the third text box of the Edit Switchboard Item dialog. Value is blank if there is no argument required.
     

Switchboard at Startup

Dialog: Startup - Display form/page = SwitchboardIf you create a database with the Database Wizard using a database template, a switchboard is automatically created that will open whenever the database opens.

If you use the Switchboard Manager to create your switchboard, you must tell Access if you want the switchboard to open when the database opens.

 Tools | Startup...  opens the Startup dialog. Set Display Form/Page to your switchboard.

Notice that you can choose to not show the Database Window or the Status Bar. You would make those choices only if your users are not allowed to make changes to the database objects nor to create new objects.


Switchboard Design View

Form Design View: Switchboard - default designCannot edit: You cannot edit the buttons or the button labels on a switchboard in Form Design View. That must be done from the Switchboard Manager. You cannot format the label text.

WarningIf you try to edit a label beside a button,  the label will vanish. When you try to switch to Form View or to open the form after saving it, you will get an error message and the form will not open! If you have not yet saved, you should close the form without saving changes. You will lose any changes, of course, but at least you will not have to reconstruct the whole form. If you already saved the form with this error, you must reconstruct the form from Switchboard Manager. It is not at all obvious which button is which since no labels are visible.

Can edit: You can change the properties for the Detail section and the text above the section with the buttons. You can add other text boxes or shapes or pictures as you wish. They will show in all switchboard pages.

The default switchboard form is more complex than it may look at first. The teal color on the left side of the form is actually a picture. Across the top is a rectangle shape with a background color that matches the picture. The dark gray bar between the teal and light gray sections is another colored rectangle. The gray section with buttons is all that is showing of the underlying Detail section.
 

Default switchboard - grouped text boxes create shadowed textThe text above the buttons, Language Arts Classes, is in the Caption property for the text box, which is actually a grouped object. The  group includes a label for white text and one for the gray shadow text. So now you know a trick for creating your own shadowed text!
Revised switchboardYou can change a lot in the Form Design View. You can change colors, add pictures, move the buttons and labels. Just don't try to edit those buttons and labels!
 


Icon: Step-by-Step 

Step-by-Step: Switchboard Form

 Icon: Step-by-Step

What you will learn:

to create a switchboard
to inspect how a switchboard works

Start with:  Class diskresource files, worldtravel.mdb from the previous lesson

Now that you have several forms and reports, you can create a switchboard form for the items that you expect to use the most often.

Create a Switchboard

  1. Menu: Tools | Database Utilities | Switchboard ManagerFrom the menu select  Tools | Database Utilities |Switchboard Manager
    Since this database does not have any switchboards yet, you see a message offering to create one.
    Message: The Switchboard manager was unable to find a valid switchboard in this database. Would you like to create one?
  2. Click on Yes.
    Switchboard Manager: Main, onlyThe Switchboard Manager appears with one switchboard showing, Main, which is the default.

    You are ready to add some items to the switchboard.
     


 Edit Main Switchboard

The New... button in the current window is for creating additional switchboard pages. To add items to the switchboard you just created, you must use the Edit button.

  1. Switchboard Manager: Edit Switchboard page - MainClick on the Edit... button.
    The Edit Switchboard Page dialog appears.
     
    In this dialog, the New... and Close buttons are the only buttons available, until you actually add some items to the switchboard.
     
  2. Dialog: Edit Switchboard Item, default choicesClick on New...
    The dialog Edit Switchboard Item appears with default choices.
     
  3. Dialog: Edit Switchboard Item, to open Staff-tabbed-fullnameFor Text, type Staff Form.
     
  4. For Command, choose Open Form in Edit Mode.
     
  5. For Form, select Staff-tabbed-fullname.
     
  6. Click on OK.
     

    Dialog: Switchboard Page - shows new item for Staff FormThe Edit Switchboard Page dialog now shows your new item.
     

  7. Click on New... again.

     
  8. Dialog: Edit Switchboard Page - 5 itemsCreate the following new items
    • Text = Clients Form
      • Open Form in Edit Mode
      • Clients-header
    • Text = Add Project
      • Open Form in Add Mode
      • Projects Form
    • Text = Report: Clients
      • Open Report
      • Clients - country totals
    • Text = Exit Database
      • Exit Application.
         
  9. Click on Close and on Close again, to close all of the switchboard windows.
     
  10. Database Window: Forms: SwitchboardIn the Database Window, show the list of Forms.
     
  11. Double-click the new form Switchboard.
    The new switchboard opens with your choices as buttons.
    Form View: Switchboard
  12. Starting from the top of the list, click each of the buttons to be sure that they do what you expect. Verify that it was what you meant to choose. Close the window and click the next button.
     
    Be warned - the last choice, Exit Database, will close the database. Access will remain open, with no database showing. This is useful only if you plan to open another database right away!
     
  13. Reopen the database.
    (Hint: File | most recently used files list at the bottom of the menu)

    The switchboard does not open automatically! You have to tell Access that you want that to happen.
     

Switchboard Loads at Startup

Since you created your switchboard with the Switchboard Manager, you must tell Access to open it when the database opens. That choice is in a special dialog, Startup.

  1. Dialog: StartupFrom the menu select  Tools | Startup... .
    The Startup dialog appears.
     
  2. In the box Display Form/Report, choose Switchboard from the drop list.
     
  3. While you are here, for Application Title, type World Travel Inc.
     
  4. Click on OK.
     
  5. Close the database and reopen it.
    This time the switchboard opens automatically and the application's title bar shows your new title. The Database Window still shows the file name, worldtravel.

Access window after restarting with new Startup options


Form Design View: Switchboard

If you do not like what you see in the Switchboard, you can do some editing in Form Design View. But you must be very careful or you can break the form. The text on the form is safe to edit.

You cannot edit the buttons or the button labels on a switchboard in Form Design View. That must be done from the Switchboard Manager. You cannot format the label text.

  1. Form Design View: SwitchboardSwitch to Form Design View for the Switchboard form.
     
  2. Click on the text box containing the text worldtravel.
     
  3. In the Properties dialog, change the Caption property to read World Travel Inc.
     
    If you try to edit directly in the text box, the whole box turns white and your white text is invisible!
     
  4. Click out to another text box to accept the change.
     
  5. Icon: Save Save your form and close it.