Forms & Reports:
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.
Project 4: Forms & Reports
Access 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
The 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.
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
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!
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
When 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.
What you want to see beside the button in the switchboard window.
Be descriptive but short.
Command: 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.
The 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.
you choose Exit Application, there is no third box at all. That command
does not require any additional information.
don't show after closing Switchboard Manager:
Table for Switchboard
When 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.
Switchboard at Startup
If 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.
| 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
Cannot 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.
If 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.
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!
Start with: , resource 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
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.
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.
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 Cor. 10:31 ...whatever you do, do it all for the glory of God. ~~