Building the structure of a switchboard


Adding new switchboards

Every step in the Switchboard Manager asks you to select from a series of options. This makes getting started a little difficult because you can't add anything to the main switchboard until that item exists in the switchboard system. The first thing to do then is to add all the subsidiary switchboards that you are going to need. Click the New button and enter the name of a new switchboard when the Create New dialog appears. Keep doing this until you have all the second-level switchboards that you are going to need. In our system we added switchboards named Client, Enquiry, People and Reports.

[The Switchboard Manager with new entries.]

Once these lower level switchboards exist you can go back to your main switchboard and start adding entries to it. Click the Edit button then make changes to the Edit Switchboard Item form that appears:

[Adding new switchboards to the Switchboard Manager.]

The Text entry will appear saying "New Switchboard Command". Change this to the wording you want the user to see. Leave the Command as "Go to Switchboard" and pick the switchboard that you want from the dropdown list.

This dropdown list is the reason why you have to define the lower-level switchboards before you can finish the design of the main one. It's annoying but it does force you to spend a little time thinking about the structure of the application before you start working on it.

Adding forms

As with the lower-level switchboards, the forms have to exist before you can add them to the switchboard structure. If the form exists then the Switchboard Manager gives you two options in the dropdown list of commands: Open Form in Add Mode and Open Form in Edit Mode. Splitting the functions like this gives a consistent appearance to the whole system. Users will always see similar pages in front of them. In our example the Clients option leads them to a switchboard offering "Add Client" and "Edit Client" and a couple of more complex options. The "Enquiry" page looks much the same.

If you have a simple database application then a single switchboard might give you enough options. The form has eight buttons so if you only have four or five forms there is no need to add any subsidiary switchboards. Every form can have a button on the main switchboard.

Navigation

The structure created by the Switchboard Manager gives you no way of going back up the tree. Remember to add a "Return to main switchboard" entry after you've added the entries for forms and reports on each switchboard. The main switchboard needs a different approach to let the user close the database.

Select the main switchboard on the Switchboard Manager dialog. Click New as usual to add a new entry but select Exit Application from the dropdown list of commands.

[Adding a close button to the Switchboard Manager.]

Part 1 Getting started
Part 3 Improving the appearance
Part 4 Behind the scenes


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map