Home

Introduction to the Records of a Table

 

Data Entry Fundamentals

 

Introduction

After creating a table, you (actually the user) can start(s) populating it with information. Data entry consists of entering data into the database. To do this, you can use a table or some of the other objects we will study.

Data is entered in a table by typing it into cells. Some fields can be configured to accept some types of data and reject others. Some other fields would allow anything. This depends on how the database fields were setup.

 

A table's cell holds one particular unit of data. All cells on the same (vertical) column belong to the same category of information. As reviewed in the previous lesson, a horizontal range of cells is called a record; and all cells on this range belong to the same record:

After typing data into a cell, you can press Enter or Tab to move the caret to the next cell. In many circumstances you will also be able to move to the next cell by pressing the right arrow key. Sometimes you can move to the next record even if the current record is not completed. In this case, you could press the down arrow key.

There are three kinds of fields or cells the user will face: a field in which the user can type data, a field that displays a list as a combo box the user has to select from, and a field that does not receive input from the user. If you as the user have to select from a list, click the field that holds the list and select from the combo box. There are two kinds of combo boxes, those that accept new entries from the user and those that allow only a selection from a preset list. The classic field allows the user to just type the appropriate data in a field.

After setting the data in a particular field, you can click another cell and type the desired data. The easiest way is to press the right arrow key to move to the next field or the left arrow to move to the previous field; pressing Enter would work as well. After typing data, if you press Enter at the end of a record, the caret would move to the beginning of the next record. At anytime, you can press the up arrow key to move to the same category field of the previous record. If you press the down arrow key, the same category of the next record would receive focus.

Practical Learning: Performing Data Entry on a Table

  1. Start Microsoft Access
  2. To create a new database, click the Office Button and click New
  3. Under New Blank Database, click Blank Database
  4. Change the File Name to Bethesda Car Rental1 and click Create
  5. With the new default table displaying, double-click ID and type CompanyAssetID
  6. Double-click Add New Field
  7. Type Category and press Enter
  8. For the next column name, type Make and press Enter
  9. For the next column, type Model and press Enter
  10. For the next column, type Date Acquired and press Tab
  11. For the next column, type Purchase Price and press Enter
  12. To save the table, right-click Table1 and click Save
  13. Set the Name to Company Assets and click OK
  14. Click the first empty field under Category and type Printer 
  15. Press Enter and type HP for the Make
  16. Press Tab and type LaserJet 4200dtn as the model
  17. Click the empty box under Acquired Date and type 10/08/2006
  18. Complete the table as follows:
     
    Category Make  Model  Date Acquired Purchase Price
    Printer HP  LaserJet 4200dtn 10/08/2006 1950.95
    Desktop Computer  IBM  NetVista M42 10/08/2006 1035.00
    Laptop  Gateway  200XL  12/05/2006 2095.95
    Printer  Xerox  Phaser 8200 10/22/2006 1250.55
    Digital Camera Olympus  C-50 11/06/2006 450.75
    Desktop Computer IBM  ThinkCentre S50 10/08/2006 1055.55
  19. Close the Company Assets table

Data Entry From an External Source

You can also enter data created from, or using, another application. For example, you can use a list from a text file or a spreadsheet. If you intend to import a text document, format it so that Microsoft Access can recognize where a field starts and where it ends. A simple file can be created using Notepad. If the file is from another type of application, you can first convert its data to text, save it as a text file, and then import it.

If you are creating the (text) file in Notepad, the delimitation of a field is usually done by pressing Tab after creating the fields' content. Instead of the Tab key, you can also use a comma or a semi-colon to separate two fields. Since a field is usually made of more than one word (such as an address), enclose the content of each field in double quotes, as in "1600 Pennsylvania Avenue".

A file that contains the data to be imported must also indicate where a record starts and where it ends. If you are creating the file in a text editor, the delimitation of a record is done by pressing Enter at the end of each record. 

When importing data, you use a wizard that will assist you in identifying the document, the fields’ delimiter, and the target table where you would like to store the new data. You can create a new table or use one already created in your database.

Just as you can import data from a text file, you can also import the records from another Microsoft Access database, a spreadsheet from Microsoft Excel or else, or a table from another database environment such as Microsoft SQL Server, Corel Paradox, Oracle, etc.

Practical Learning:  Importing a Text Document

 
  1. Start a text application, such as Notepad (Start -> (All) Programs -> Accessories -> Notepad)
  2. Type the following:
     
    "First Name","Last Name","Title","Home Phone"
    "Georgette","Hopps","General Manager","(301) 722-2820"
    "Robert","Laskin","Clerk","(202) 333-3366"
    "Suzie","Waller","Intern","(202) 546-8277"
    "Judith","Walsh","Clerk","(301) 599-1890"
    "Patrice", "Arlane", "Shift Supervisor","(301) 185-2208"
  3. On the main menu of Notepad, click File -> Exit
  4. When asked whether you want to save the file, click Yes
  5. Set the File Name to Employees (leave the Save As Type to Text Document) and click Save
  6. In Microsoft Access, the Bethesda Car Rental1 database should still be opened.
    On the ribbon, click External Data
  7. In the Import section, click Text File
  8. In the Get External Data - Text File dialog box, click the Browse button
  9. Locate the Employees.txt file you saved and select it
  10. Click Open and accept the first radio button
     
  11. Click OK
     
    Import Text Wizard
  12. On the first page of the Import Text Wizard, accept that the text be Delimited and click Next
  13. On the second page, accept that the delimiter be set to Comma and check the box stating: First Row Contains Field Names
     
  14. Click Next
  15. Accept the defaults of the third page of the wizard and click Next
  16. Accept to contents of the fourth page of the wizard and click Next
  17. Accept to import to table Employees and click Finish
  18. You receive a confirmation message when the table has been imported.
    Click Close
  19. In the Navigation Pane, double-click the Employees table to open it
  20. Double-click ID, type EmployeeID and press Enter
  21. Close the Employees table

Form Creation

 

Introduction

You will usually not provide tables to the users for data entry. Instead, you will use objects called forms. A form appears in a view friendlier than that of a table. Here is an example of a form presented to a user:

Yugo National Bank - Customers Transactions

For you as the database developer, a form only serves as a relay between the source of data, which can be a table, and the user who looks at it. Of course, in order to have a form in your application, you must first create it.

When it comes to data of a database, there are two broad types of form: data-unrelated and data-related.

Unrelated Forms

Although most of the forms you will use in a database are meant to display data from a table, you can create an independent form whose functionality and behavior don't depend on the data from a database. Such a form can be used to display other types of information to the user. The form can be referred to as unrelated.

To create a blank form, on the ribbon, click Create and, in the forms section, click Blank Form. You would be presented with an empty rectangular object that awaits your touch.

Automatic Forms

The other category of form involves those used to display data to the user. Such forms are primarily made for data entry. Before creating such a form, you must decide where data would come from. The source object can be a table or other means we will study in future lessons. If the data of a form will be based on a table, you can specify it, before or while creating the form.

To easily create a form that would display data, in the Navigation Pane, select the table. In the ribbon, click Create. In the Forms section, click Form.

Practical Learning: Creating a Form Automatically

  1. Open the Bethesda Car Rental1 database
  2. On the Navigation Pane, click the Employees table to select it
  3. On the ribbon, click Create
  4. In the Forms section, click Form

The Name of a Form

Like a table, you can create a temporary form to test something and get rid of the form after use (you do this by not saving the form). As done for a table, if you intend to preserve a form, you must save it. To save a form:

  • You can right-click its tab and click Save
  • You can attempt closing the form. You would be prompted to save the form

If the form was not saved previously, you would be prompted to give it a name. Like every object of a database, a form must have a name. Microsoft Access is very flexible when it comes to names of objects. For example, a form can be named D#%bb or 5&#GM* or anything like that. As you can imagine, such names are not realistic. For this reason, you should give easily recognizable names to your form so you would be able to predict what the form is used for. If a form is based on a table, it may be a good idea to give the same name as the table. If a form is independent, that is, if it doesn't display data from a table, you can give it a name that reflects its role in the database.

Practical Learning: Naming a Form

  1. On the form tab, right-click Employees and click Save
  2. Accept the suggested name for the form as Employees and click OK
  3. Close the form

The From Wizard

For a typical database, a form is used to view, enter, manipulate, and search data. Because users spend a great deal of their time looking at forms, you should create and make them as attractive and friendly as possible. Form design can take a long time in database development but Microsoft Access provides quick means to get around. The Form Wizard provides an easy and fast means of creating a form.

To launch the Form Wizard, in the ribbon, click Create. In the Forms section, click More Forms, and click Form Wizard. This would start the wizard. The first page of the Form Wizard allows you to choose the originating table that will supply the necessary fields in the form. Once you have selected the object, its corresponding fields display in the Available Fields list box, you can select all fields or decide which ones you want to include in the form. The 2nd page of the wizard allows you to select the desired layout of the form. The 3rd page of the Form Wizard presents the forms designs you can choose from. The 4th page allows you to name the form.

Practical Learning: Using the Form Wizard

  1. Open the Rockville Techno database
  2. On the ribbon, click Create
  3. In the Forms section of the ribbon, click More Forms and click Form Wizard
  4. In the first page of the wizard, in the Tables/Queries combo box, select Table: Company Assets
  5. In the first page of the wizard, click the Select All Fields button Select All
     
    Form Wizard
  6. Click Next
     
  7. Accept or choose the Columnar layout, then click Next
     
  8. Click the Equity style and click Next
     
  9. Accept the name of the form as Company Assets and click Finish
    An automatic form is created for you
     
    Company Assets
  10. To close the form as a Windows object, click its Close button Close

Data Entry on a Form

Data entry of a database is mainly performed on forms as they provide a friendlier display of information than tables. Data entry on a form is performed using various types of Windows controls. On text boxes, the user enters data by typing it. On a combo box, depending on how the object was configured by the database developer, the user may have to only select an item from the list. In some other cases, the user may be allowed to enter new data.

After entering or changing data on a control, to move from one field to the next, the surest way is to press Tab. On most occasions, the user can also press Enter. The Enter key may not move the cursor from a text box that allows multiple lines of text. If the user is simply reviewing data without performing data entry, the keyboard’s arrow keys can also be used to move among fields.

Practical Learning: Form Data Entry

  1. Open the Bethesda Car Rental1 database
  2. To create a new table, on the ribbon, click Create
  3. In the Tables section, click Table
  4. Double-click ID and type CustomerID
  5. Double-click Add New Field, type Full Name and press Enter
  6. Create the following additional columns:
     
    CustomerID
    Full Name
    Driver's License #
    Address
    City
    State
    ZIP Code
    Country
  7. To save the table, right-click Table1 and click Close
  8. When asked whether you want to save it, click Yes
  9. Set the Name to Customers and press Enter
  10. To create a new form, on the ribbon, click Create
  11. In the Forms section, click More Forms and click Form Wizard
  12. In the Tables/Query combo box of the first page of the Form Wizard, select Table: Customers
  13. Click the Select All button and click Next
  14. Accept the Columnar Layout and click Next
  15. In the style page, select Paper and click Next
  16. Accept the suggested name of the form as Customers and click Finish
  17. Click the text box on the right side of Full Name and type Ernestine Aarons
  18. Press Tab and type A-682-638-146
  19. Press Enter and type 6044 Lolita Drive
  20. Click the text box on the right side of Country
  21. Type USA and press Tab. Notice that you have moved to the next record
  22. Click the text box on the right side of Full Name and type Raymond Simms
  23. Click the Next Record button to get to the next record
  24. Click the text box on the right side of Driver's License # and type 837-62-5860
  25. Click the Previous Record button twice to return to the first record
  26. Complete the form with the following records:
     
    Full Name Driver's License # Address City State ZIP Code
    Ernestine Aarons A-682-638-146 6044 Lolita Drive Silver Spring MD 20904
    Raymond Simms 629-49-2746 815 Arundela Rd NE Washington DC 20008
    Johnny Edmondson 837-62-5860 10696 Great Alberta Crt Alexandria VA 21233
    Albert Faughty F-374-590-749-205 702 Mechanics Drv College Park MD 20707
  27. To close the form, click its close button Close

Introduction to Record Printing

 

Table Printing

The primary function of the table is to provide a means of storing and arranging information of a database. Nevertheless, you can print data of a table, especially if for example you are in a hurry and don't have access to another object. You can print data on a table whether the table is opened or not.

To print a closed table, locate it in the Navigation Pane and click it to select it, then click the Office Button, position the mouse on Print and select one of the three options. In the same way, if the table is opened in Datasheet View, click its tab to give it focus, then click the Office Button -> Print and select to print or to preview.

The Print menu of the Office Button presents three options:

 

  1. If you click Print, the Print dialog box would be presented to you. It allows you to specify the printer you want to use. Most of the time, the Name combo box will present the default printer; otherwise, you can select one:
     

     
    After specifying the printer, if you are ready to print, you can click OK. To customize the printing job, you can click Properties. A dialog box, whose contents depend on the selected printer, would come up. Among the various options you would have is that of specifying the orientation of the paper (Portrait or Landscape). Again, remember that different printers provide different features. Here is an example of the Properties of a printer that would allow you to print on both sides of the paper:
     
    Printer Properties
     
    After setting the properties of the printer, you can click OK. Once you are ready to print, you can click OK on the Print dialog box to send the job to the printer
  2. If you select Quick Print from the Print menu of the Office Button, the print job would be sent directly to the printer. Microsoft Access would use the default printer that is set in Control Panel and would use the previous settings that were set on that default printer
  3. If you select Print Preview, Microsoft Access would draw a print job on the screen for you. This allows you to see what the final job would look like on the paper. The characters on the screen may appear too small for you. To zoom in, you can click the middle of the window. To zoom out, you can click it again. Once you are ready to print, on the ribbon and in the Print section, you can click Print. This would send the print job to the printer
 

Practical Learning: Printing Tables

  1. In the Navigation Pane, click the Customers table to select it
  2. To print data from the table, click the Office button, position the mouse on Print and click Quick Print
  3. From the Navigation Pane, double-click the Company Assets table to open it
  4. Click the Office Button, position the mouse on Print and click Print
  5. Select the desired printer Name combo box and click Properties
  6. Based on your printer, select the Landscape radio button (usually in the Orientation section of a Paper Layout tab) and click OK
  7. On the Print dialog box, click OK
  8. Close the table

Form Printing

Although not part of their primary role, forms provide a quick means of printing data, especially in the absence of desired reports. There are various issues related to printing forms, including printing all records or just some of them.

You can print a form without opening it. Once you know the form you would like to print, locate its name in the Navigation Pane and use the same steps reviewed for a table.

When a form is opened, you have the option of printing all of its records or the selected one. In the Form View, to print just one record, navigate to the record you would like to print, click the Form Selection bar to select the record and proceed to print.

 

Practical Learning: Printing Forms

  1. From the Navigation Pane, double-click the Customers form to open it
  2. Click the Office Button, position the mouse on Print and click Quick Print
  3. To navigate to the 3rd customer, click the Next Record button twice
  4. Click the Office Button -> Print -> Print
  5. On the Print dialog box, click the Selected Record(s) radio button
  6. Click OK
  7. Verify that only the displaying employee's record was printed
  8. Close the Employees form
  9. To create a new form, on the ribbon, click Create
  10. In the Forms section, click More Forms and click Form Wizard
  11. In the Tables/Query combo box of the first page of the Form Wizard, select Table: Employees
  12. Click the Select All button and click Finish
  13. Now we will print records from 2 to 4.
    Click the Next Record button to navigate to record No.2
  14. Click the Record Selector bar
     
  15. Press and hold Shift. Click the Next Record button twice to display the fourth record where the EmployeeID field would display 4 (even though the record # still displays 2)
  16. Release Shift
  17. On the ribbon, click the Office Button -> Print -> Print
  18. On the Print dialog box, click the Selected Record(s) radio button and click OK
  19. Verify that records from 2 to 4 have been printed
  20. Close the Employees form

Reports Fundamentals

 

The Report Wizard

A report provides an object used to print a database's records. Although you can print tables or forms, reports are customized to be printer friendly. They can perform and display calculations. Once again, Microsoft Access provides wizards to quickly create reports.

Microsoft Access can help you quickly create a report using one of the pre-designed layouts. This is done using the Report Wizard. The Report Wizard is available from the Reports section of the Create category of the ribbon.

Practical Learning: Using the Report Wizard

  1. On the ribbon, click Create
  2. In the Reports section, click Report Wizard
  3. On the first page of the wizard, click the arrow of the Tables/Queries combo box and select Table: Employees
  4. Click the Select All Fields button Select All
  5. Click Next
  6. Accept anything in the second page and click Next
  7. Accept anything in the third page and click Next
  8. In the Layout section, click the Columnar radio button:
     
    Report Wizard
  9. Click Next
  10. Click Next
  11. Accept the suggested Title of the report as Employees and press Enter
     
  12. Close the report

Report Printing

The report is the favorite object used to print data. As done with the other objects, you can print a report whether it is opened or not. Before printing a report, you must first select or open it. If you want to print a report without opening it, in the Navigation Pane, locate the desired report and click it to select it. Then, proceed from the Office Button as we reviewed for the table and the form. In the same way, you can first open the report from the Navigation Pane and use the Print menu from the Office Button the same way we described for the other objects.

Practical Learning: Printing a Report

  1. The Employees report should still be opened.
    Click the Office Button, position the mouse on Print and click Print Preview
  2. To start the printing process, in the Print section of the Print Preview, click Print
  3. On the Print dialog box, select the printer and make sure the All radio button is selected
  4. Click Properties, click the Portrait radio button (in the Orientation section) and click OK
  5. To send the print job to the printer, on the Print dialog box, click OK
  6. Close the Employees report
 

Previous Copyright © 2007, yevol.com Next