Information Technology in a Global Society

Databases: Part 2

Databases have two views to the outside world. One view is for the person who is going to be putting information into the database. That is normally done through a form although information can come from many sources, both human and machine.

The other view of a database is for people who will be getting information out of the database. There are also many ways to see information that is stored in a database but one of these is called a report. A report is normally information that is printed out on paper for people to read. But of course people can also view information from the database on the screen either through the database itself or on a very commonly on a web page.

Creating a Form



Creating a form in Access is extremely easy. Follow these steps to create your first form for the student table:
  1. Open Microsoft Access.
  2. Open the database that you should have saved to your network drive (File--Open).
  3. Click on the word Forms in the database box.
  4. Select Create form by using wizard.
  5. Select the student table from the dropdown.
  6. At this point you can select the fields you want to see displayed in the form. If you hit the double arrow all of the fields will be added at once.
  7. At this point you can select additional options or just hit Finish. Your form will be created.
  8. At this point you can double-click on the form to open it.
  9. Try entering more students using your form. You can do that by moving to the end of your list of students to get a blank form (hit the arrow with the *).
  10. This form is OK, but it would look better if you formatted it some.  Try to make the form look like the one below.  To change to design view (in order to edit), switch to design view (in the View menu).



     
  11. Create a form for your grades table in a like manner but when you get to the screen asking you for a layout for your form choose tabular instead of column layout.  Save that form by calling it "grades". 

A More advanced Form

You may want to see information that is related to a student record in your form. Commonly a form will contain information from more than one table. For instance, a student has a list of grades. You probably want to see the grades for a specific student listed under their name in the form. Let's do that now.
  1. Open your student form in the design view (you have to click on the Design button).
  2. You will have to make your form bigger. Expand the window and click and drag on the form footer bar to expand the form to make room for the grades.
  3. You will notice a toolbox floating up to the left. Click on the Subform button (look for hint).
  4. Then click and drag in your student form to place the subform for the grades (create a box below the other fields.   There will be a warning about a missing Wizard.  Choose "No" on the install.
  5. Right-click on the new subform and choose properties from the menu.
  6. Under source object, select the grades form you created from the dropdown menu.
  7. Now, how are the grades for a particular student linked to that student's record?  Well, by the student ID of course.  So you have to do that now.  In the properties dialog box choose link child fields.   In the dialog box choose the student id from each table (named differently in both tables) and hit OK.
  8. Your new form with the subform may not look very satisfactory.  Modify the design of the subform to make it look better, change these properties to this:
    can shrink:  No
    can grow:  No
    border style:  Transparent
  9. Then right click in the subform to set it's form properties like this:
    horizontal scroll bar:  NO
    vertical scroll bar:  NO
    Record navigation buttons:  NO
    Control box:  NO
    Border style:  None
    Min Max buttons:  None
  10. Now, notice that the the student ID is repeated for each grade.  You don't really want to see that over and over again.  So, delete that field and move the fields over so that it looks like this: