Creating the Application Menu
Making it easy for the user
One of the things you should have learned from the 9 preceding lessons (among many others) is that you should always keep the user in mind when you design an application.
In the Video store the users are the employees who can answer questions about renting games machines, the latest release of Doom, popular oldies, the lives of the Stars and the Top 10 movies of the week. They can probably discuss the latest DVD technology. But, they are usually not programmers and you can't expect them to be totally at ease with the Access development interface the way you are.
What you have to do is arrange the interface in such a way that the user can navigate through the application just by choosing tasks from a list, or as we'll see in a minute, from a menu of choices.
This idea of a menu is well-known to most people. After all, if you're working with Windows applications you use the menu bar all the time. All the functions available in the application are listed in the menu and you select the one you want to execute.
The Application Menu is similar. You create a form on which you display the choices in the form of buttons and you code the buttons so that they do the tasks you want done.
In this, as in almost everything else, there are several ways to get the same result. You may have noticed in previous lessons that I will often do things the hard way when I could call-up an Access wizard to do it the easy way. The reason for that is that I am usually teaching people how to develop and code applications as opposed to teaching them how to use Access syntax. It is just one step along the way to becoming a programmer and it is important to learn the technique behind the objects in addition to the use of the objects themselves.
In this case we'll do it the easy way. There is an Access wizard in Tools called the Switchboard manager and that's what we'll use in this lesson to develop our Application Menu. In Access the main menu is refered to as the Main Switchboard.
The Form is the key
Now, please make note of this: Every Table in the application must have a Form tied to it.
Customers, Movies, Ratings, Categories, Credit cards, etc. Even if it's a simple table with one field and three records, like Credit cards, there must be a way to access the data to change credit card names, add new cards or delete old cards. In the case of transactions, one form may update more than one table. That's OK. Usually, every form will display data from one table and will allow us to do maintenance on the data. That consists of add, delete and change operations.
It's not that big a deal. You simply use the AutoForm button to create an instant form from the table and then you customize it. Although not strictly necessary, it is highly recommended that you standardize your forms: use the same layout, same color scheme, same format for all the forms. It makes it easier for the user to feel at ease with the environment.
Also, all the special queries that must be displayed will have a Form for that. You create the form for the query the same as you do for the table.
The Main Switchboard
Creating the Main Switchboard is straightforward. You go to the Tools menu --> Database Utilities --> Switchboard Manager.
If there is no Switchboard, you will be asked if you want to create one.
If the Switchboard already exists, it will open. You can only have one Switchboard so it will never ask which file to open.
If you have to remove the Switchboard and start over for some reason, you must delete both 'Switchboard' from Forms and 'Switchboard Items' from Tables.
Again, there are several ways to go about creating the menu.
You may decide to call everything from the Main Switchboard.
Or you may want to break the tasks into functional areas: have a Switchboard page for Forms, one for Queries, one for Reports (we'll get to those in upcoming lessons) and one for Transactions like Rentals and Returns.
Once you've got all the objects accounted for in the Switchboard, you just have to get the Switchboard to load automatically and then all the user ever has to see is the Switchboard. We'll do that in the next lesson when we look at Macros. After you've got that there is no need to go into tables or queries or report structures.
Next week: Macros. See you then!