Lesson 5: Entering Data

Now that you have created the forms for your database, you will use them to add data to your tables. You will first create table lookups and use them to assist you when you enter data into the forms.

In this lesson you will

  create lookup tables
  
  enter data using the forms you created in Lesson 4 and lookup tables
  
You will need about 20 minutes to complete this lesson.

To see what your finished form will look like with data, click here.

Note

  Make sure your working directory is set to the folder where you saved the Tutorial sample files. If necessary, see "Setting your current working directory" in Lesson 2 for more information.
  
Creating a Lookup Table

Lookup tables are used as a reference to instantly identify and add information to your tables. When using a lookup, the time required to complete the field is reduced and the possibility for errors in data entry is eliminated. The following rules apply to lookup tables: 

  The field of valid entries must be the first field in the lookup table.
  
  The field that you are defining as a table lookup must have the same field type and size as the first field of the lookup table.
  
  For best performance, the first field should be the primary key for the lookup table. 
  
You'll recall that order information is required on the ORDERS table you created in Lesson 2. Often, when dealing with a large number of orders, you may know the CustomerID but not the OrderNo, or you may know the OrderNo but not the CustomerID. You will create two lookup tables that will help you enter valid data in your form. 

To create a lookup table

1.	Click Tools menu, Utilities, Restructure.

Ensure that Tables (*.DB, *.DBF) is in the Files of type box.

2.	From the Select File box, select ORDERS and click Open.

3.	On the Restructure dialog box, click the Table Lookup tab.

4.	From the Fields(Current Table) list, select CustomerID and click the right arrow to move your selection into the Field column.

5.	From the Lookup list, select CUSTOMER.DB and click the left arrow to move the table name into the Lookup Table column.

6.	Under Lookup type, enable Applicable fields.

Lookup type allows you to choose whether you wish to assign the lookup value to only the current field or to all applicable fields.

7.	Under Lookup rights, enable Fill and view.

Lookup rights determine the type of viewing access. When you select Fill only, the lookup table will not appear when entering the data in the corresponding field, but if you enter a value not present in the table, Paradox will display an error message. When you enable the Fill and view button, the lookup table is displayed and allows you to select a value to enter into the corresponding field.

8.	Click Save.

You will now create a lookup table based on the VIDEO table.

To create another lookup table

1.	Click Tools menu, Utilities, Restructure.

Ensure that Tables (*.DB, *.DBF) is in the Files of type box.

2.	From the Select File box, select ORDERS and click Open.

3.	On the Restructure dialog box, click the Table Lookup tab.

4.	From the Fields(Current Table) list, select ItemNo and click the right arrow to move your selection into the Field column.

5.	From the Lookup list, select VIDEO.DB and click the left arrow to move the table name into the Lookup Table column.

6.	Under Lookup type, enable Applicable fields.

7.	Under Lookup rights, enable Fill and view.

8.	Click Save.

Entering data using your form

Now that you have completed the design of your form, you can use it to enter data into your tables. Working with forms is very similar to working directly with a table, only the view of the data is different. Once you enter data into the form, it is automatically added to the table. 

The first scenario you are going to work through is entering new customer data for Training by Design's customer table. With the addition of videos to TBD's product line, the company has attracted new customers. The new customer data needs to be entered into the CUSTOMER.DB table, so that new customers will receive all TBD mailouts and TBD will have a record of the new customers' purchases.

You will use the linking form you created to access the other two forms.

To open the form

1.	Click File menu, Open, Form.

2.	Double-click Link.

3.	On the Link form, click the Add New Customer button.

The New Customer form opens in Run mode. You can now use it to enter new data into the CUSTOMER.DB table.

To enter new customer data 

1.	Press F9 to enter Edit mode.

2.	Click Record menu, Insert.

3.	In the Form, enter the following customer information (use TAB to move between fields):

  Customer ID-3205
Martha Green
Unleashed Corporate Training
5200 Finch Ave. E.
Scarborough, ON
Canada, M1B 5X7
116-555-8748
  
4.	Click Record menu, Insert after each entry to enter the next record.

  CustomerID-3210
Richard Monet
Training for Tomorrow
3200 S.W. 123rd Street
Miami, Florida
U.S.A., 33176
105-555-6551
  
  CustomerID-3215
Yvonne Clifford
Interactive Design Corporation
35 103rd Street
Indianapolis, Indiana
U.S.A., 46290
117-555-1454
  
5.	Click File Menu, Close.

These new records are now added to the CUSTOMER.DB table. You can open the table to verify that the new records were entered.

To open a table

1.	Click File menu, Open, Table.

2.	Double-click CUSTOMER.

3.	Scroll to the end of the table and verify that the new records were added.

4.	Click File menu, Close.

Entering Data for a new order

You've now entered information for new customers. You will now use the lookup tables you created earlier in this lesson to enter new video order information into the Orders table. Make sure the Link.fsl form is open.

To enter a new record

1.	On the Link form, click the Place New Video Order button.

2.	Click View menu, Edit Data.

3.	Click Record menu, Insert.

To enter data into the new record

1.	In the OrderNo field, enter "1" and press ENTER.

Paradox will not let you enter "1" because it is an invalid character. This is because you set a picture of four number digits (####) for this field when you created the table. 

2.	Press the BACKSPACE key and enter the value "0001" and press ENTER.

3.	Press TAB to move to the next field.

4.	Press CTRL + SPACEBAR to access the lookup table for the CustomerID field.

5. In the Lookup Help dialog box, scroll to locate the CustomerID field 3205, select it, and click OK.

Paradox adds the CustomerID to the CustomerID field.

6.	Press CTRL + SPACEBAR to access the lookup table for the ItemNo field.

7.	In the Lookup Help dialog box, select the ItemNo field 2000 and click OK.

Paradox adds the ItemNo to the ItemNo field. Paradox also automatically adds the Title of that ItemNo to the Title field. (This is because you specified All Corresponding fields when you created the Lookup table).

8. TAB down to the Qty field, enter in the value "12," and press ENTER.

Paradox performs the calculation and puts the value in the Total Price field.

You have entered the data for the first record. If you were to open up the ORDERS.DB table, the data that you entered would appear in its records. Now you will enter three more records.

Entering additional records

You will enter three more records into the form.

To enter the second record

1.	Press TAB to move to the next record.

2.In the OrderNo field, enter the value "0002" and press Enter.

The cursor moves to the next field.

3.	Press CTRL + SPACEBAR to access the lookup table for the ItemNo field.

4.	In the Lookup Help dialog box, click the ItemNo field 2001 and click OK.

5.	Press TAB to move to the next field.

6.	Press CTRL + SPACEBAR to access the lookup table for the CustomerID field.

7.	In the Lookup Help dialog box, scroll to locate the CustomerID field 3210, select it and click OK.

8.	TAB down to the Qty field, enter in the value "5" and press ENTER.

Paradox performs the calculation and puts the value in the Total Price field.

To enter the third record

1.	Press TAB to move to the next record.

2.In the OrderNo field, enter the value "0003" and press ENTER.

3.	Press CTRL + SPACEBAR to access the lookup table for the ItemNo field.

4.	In the Lookup Help dialog box, click the ItemNo field 2002 and click OK.

5.	Press TAB to move to the next field.

6.	Press CTRL + SPACEBAR to access the lookup table for the CustomerID field.

7.	In the Lookup Help dialog box, scroll to locate the CustomerID field 3215, select it, and click OK.

8.	TAB down to the Qty field, enter the value "10," and press ENTER.

Paradox performs the calculation and puts the value in the Total Price field.

To enter the fourth record

1.	Press TAB to move to the next record.

2.In the OrderNo field, enter the value "0004" and press ENTER.

3.	Press CTRL + SPACEBAR to access the lookup table for the ItemNo field.

4.	In the Lookup Help dialog box, click the ItemNo field 2003 and click OK.

5.	Press TAB to move to the next field.

6.	Press CTRL + SPACEBAR to access the lookup table for the CustomerID field.

7.	In the Lookup Help dialog box, scroll to locate the CustomerID field 3215, select it, and click OK.

Customer 3215 has placed two orders for different videos.

8.	TAB down to the Qty field, enter the value "15," and press ENTER.

Paradox performs the calculation and puts the value in the Total Price field.

These new records are now added to the ORDERS.DB table. You can open the table to verify that the new records were entered.

To open a table

1.	Click File menu, Open, Table.

2.	Double-click ORDERS.

3.	Verify that the new records were added.

4.	Click File menu, Close.

 Summary of Lesson 5

In this lesson you learned how to

  use the form to enter new data
  
  use lookup tables to enter new data
  
  use the form to edit existing data
  
In Lesson 6 you will learn how to create a report based on a data model.

Finished form with data









