| Creating
an Access Database: A Primer for Resource Center Managers by
|
Creating and Modifying FormsTable of ContentsIntroductionAn Example of a Form Parts of a Form Planning the Forms Using the Serials Database Creating a Form using Form Wizard - Simple Instructions Creating a Form Using Autoform Creating a Form using the Form Wizard Modifying a Form Creating a Form using Design View Creating a Form Table of Content Page Using Switchboard Forms (not covered in workshop) Modifying a Form Assignment 1 Assignment 2 Assignment 3 For More Information IntroductionThere are two ways to enter information into the database. You can use the Datasheet view and key the information directly into a table or you can use a Form.Forms enable you to enter data into tables much more simply than trying to enter it into the spreadsheet view. You can enter and view one record at a time. Often this is less confusing to the data entry person since there isn't so much information on the page. Forms look nicer and are generally (if well designed) easier to enter data into. You can also customize the forms by changing arrangement, font, font size and color and by changing the background. Most of the forms will correspond to the tables, but not always. And you might want to incorporate more than one table into a form to make it easier to enter data. Forms allow you to select specific fields from the record to display. You can also specify the field order in the Form. If you use the Design view, you can arrange the fields to meet your needs. A well designed form makes entering data and locating records easier. Access enables you to set aside portions of your form for calculations, while lines and rectangles used as graphic elements are designed into the form when you create it. We will not be doing serious calculations in any of our forms. You can also create a switchboard form which acts as a table of content to your database. The switchboard form enables you to open other forms or reports. We will not be covering switchboard forms in this workshop, although you have already seen what a switchboafd form looks like in the Students and Classes database. Although we will not be discussing it here, you can also create a custom dialog box into which you can enter data, and then carry out a process based on the data you entered. Before you begin designing forms, you should be sure that you have created appropriate field types in your tables. A text or memo field is going to work much differently than a number field. Be sure that you have assigned any table properties. Table properties affect the whole table so it's important to get those right. It makes a fair bit of sense to design forms on paper before you work on designing them in the database, or at least have a clear idea of what you want to include. So, rough out where you want which piece of information and redo till the form works out for reading and data entry. Think hierarchically, since the switchboard is really a menu of options. I will often create a shadow database (I call it Serials1) where I do my testing of forms. I then redo them in the "good" or "real" version of the database. An Example of a FormThis is an example of a form from the Students and Classes database.
What does this form enable you to do? It enables you to enter various
kinds of information about the student such as contact information, classes
taken, Instructor, which department they are in, and quite a bit of information
on various assignments. This form is put together from several tables.
Parts of a FormA form is made up of four parts:
Planning the Forms for the Serials DatabaseLet's ask ourselves which forms might we want to create which are stand alone and which might we wish to incorporate into one form. In the table below I've suggested some possibilities but I've also left some space for you to add some additional tables. There may not be enough room in the spaces for all the forms you want to create, but you can add them to your Access database at a later time.
Creating Forms for the Serials DatabaseAccess has made it relatively simple to add forms. If you know that you just want a simple form which looks similar to the Dataview table, use the AutoForm feature. If you have a slightly more complex form, use a Form Wizard which prompts you for information and creates a form based on your answers. Even if you feel comfortable creating forms, you may want to use a Form Wizard to quickly lay out all the controls on your form. Then you can switch to Design view to customize it.Be sure to read Optimize form and subform performance in Access Help to get a list of suggestions for making your forms run faster Creating a Form using AutoFormAutoForm is a very simple method of creating forms since it creates a form that displays all fields and records in the selected table or query. Each field appears on a separate line with a label to its left. This method of making forms does not allow you to join tables to create a form.From the Database window, click the Tables or Queries
tab once and select the table or query you want to base the form
on. Then click the arrow next to the New Object You can also click on the Forms Tab, then Insert | Form, New Form and select the table you wish to base the form on. Forms can also be created from queries. The process is the same.
Example of the Publisher Table after using Autoform
Note that Autoform just creates a two column list. We will edit it in a few moments to make it look a little better. Creating a Form with a WizardWhile you are in the Database window, click the Forms tab, then New. When the New Form dialog box appears, select the wizard that you want to use. Notice that a description of the wizard appears in the left side in the dialog box. Select the name of the table or query that includes the data you want to base your form on. You don't need to do this step if you click the Form Wizard option since you can specify the record source for the form in the wizard. Then click OK.Create a Form with Tabs (discussed but not practiced) You can use a tab control or a page break control to create a multi-page or tab form. The advantage to a multi-page form is that everything to perform an action is available without having to return to the Database window and locate the next form, open it up and start entering. Since the tab control method is the easiest and most effective way to create a multiple-page form, I will give you those instructions. Use Access help to learn how to create a multi-page form. Open an existing form in Design view. In the toolbox, click the
Tab Control tool The next step is to add controls to the tab control. You do this by
clicking the tab of the page you want to add controls to. Add controls
by using one of the methods listed below:
If you want to add, delete, or change the order of tabs, click on the border of the tab control with the right mouse button and click Insert Page, Delete Page, or Page Order to make changes. Sometimes the order of controls on the tabbed page needs to be changed for easier movement through the database. To change the tab order of controls on a page, click the page with the right mouse button and click Tab Order. To change the font name, font size, font style, and so on, of pages, double-click the border of the tab control to open its property sheet and then set the appropriate properties. You are not allowed to specify different settings for different pages. A font change, for example, affects all pages. Make the tab control as large (or small) as necessary. Test each tab to make sure all the controls fit well within each tab. Test the controls in Form view.
Creating a Form Using Design ViewTo create a new form, click the Forms tab in the Database window and click the New button. When the New Form windoe appears, select Design View. Click the down arrow and select Editor.![]() Then click on OK. The Form Screen will appear. ![]() The first thing you might want to do is to make the background area where objects will be placed a little larger. Click on the bottom right hand corner of the grey work area, hold the left mouse button down until the cursor changes shape to a four-arrowed icon and drag down and to your right to make the area larger. Notice the Toolbox which is a display of the different types of objects
that you can put on the background. (The relations between the Toolbox
and the name of the button did not show up as well as expected in the table
below, but you can get a better idea by moving your cursor over the various
buttons on the Toolbox.)
You'll use the Forms Design Toolbox to add and change Labels, add toggles,
check and radio buttons, and more. A few of the tools from the toolbox
are mentioned in the table below. Study the Access help file for additonal
tools and design ideas.
Adding a Label (Label Object)The Label Object is a static object. It doesn't change as you move between records. It is, essentially, a title. We will add the title "Journal Editors" (without quotation marks, please).From the Toolbox, select the You now have a label which looks like this: ![]() Adding a Text Object (Text (Control) Object)When you are designing forms, the Text Object will be the one that you use the most. There are two different ways we can use Text Objects. We can use the appropriate Toolbox button or the Field List box button.The Toolbox ButtonIn the Toolbox, click the![]() Now take the cursor and click on the box that says "Unbound".
Type in "Last Name" and click on Enter. You will be using
the white box to type in information. Change the Text4 label to read "Editor's
Name". Note how the box enlarges to accommodate the text you keyed
in. (Please note that on your computer, Text4 may be a different
number. It may be Text1. This is an artifact of my having worked on my
database to create other forms.)
The Field List BoxFrom the toolbar under the menu bar at the top of the window, select the Select the Title field by clicking on it with your left mouse
button. Hold the key downand drag the cursor below the Editor's Last Name
field. Notice what happens. The Text Object and the Label object are filled
in automatically for you by Access. The Label Object has whatever field
name was in the table. You can change the Label Object by clicking on the
Label Object and changing it.
In the example below, we see both the Design View and below that the Form View. ![]() ![]() If we wanted to get rid of the Labels for First Name and Middle Initial,
here's how we would do it. Select the Text box for each one theText Boxes
you want to eliminate and hit the delete key.
Modifying a FormCustomizing the Look of a FormWhile the forms created by Access with your input can look pretty good, you might want to spiff it up a little bit or even change the layout of the controls and labels.Here's how you can customize your form. You can change the background, move, size or realign controls(and change font style and size), change the current control to another type such as a radio button (for yes/no responses), change a label text, or add a field or control. Rearranging Controls and LabelsWhen we created the Publishers form using Autoform, I was not very happy with the way it looked. Let's change the appearance to make it look better.
View of the Redesigned Publisher's Form In its redesigned format, it is a much nicer looking format. It is cleaner and better organized. Plus, in its present state, it's much easier to enter data into. Creating a Form Table of Content Page Using Switchboard FormsA switchboard form is a form which makes it easy to navigate around your database. Since we created our own database rather than using the Database Wizard, we would, if we wanted to create a Switchboard Form, have to use the Switchboard Manager to create a Switchboard Form. We will discuss how to create a Switchboard Form, but will not do one as a group for this workshop.Here is the Switchboard form from the Students and Classes database for you to look at. ![]() From the Tools menu, point to Add-ins, and then click Switchboard Manager. When asked if you'd like to create a switchboard, select Yes. Actually, Access will announce that it was unable to find a valid switchboard in this database and then ask if you'd like to create one.
In the Switchboard Manager dialog box, click Edit.
In the Edit Switchboard Page dialog box, type a name for the switchboard in the Switchboard Name box, and then click New.
In the Edit Switchboard Item dialog box, type the text for the first switchboard button in the Text box, and then click a command in the Command box. Depending on which command you click, Microsoft Access can display another box below the Command box. You may want to select an item in this box. For example, if you clicked Open Form In Edit Mode in the Command box in step 5, you will need to click the name of the form you want to open in the Form box, and then click OK. Repeat these steps until you've added all the menu items to the switchboard. If you want to edit or delete an item, click the item in the Items On This Switchboard box, and then click Edit or Delete. If you want to rearrange items, click the item in the box, and then click Move Up or Move Down. Click on the Close button to stop editing the switchboard. You can use the Switchboard Manager to create a switchboard that branches to other switchboards. Choose the Go To Switchboard command in the Command box, and then specify the switchboard you want to go to. To make the switchboard form open automatically, select the switchboard
name in the Switchboard Manager dialog box and make it the Default.
For More InformationRead Working with Forms, Working with Controls on Forms and Reports and Optimize form and subform performance in Microsoft Help. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Next: Data Entry Back: Building Relationships |