Adding Records to the HRActions Table

Now you can test your work in creating the HRActions table and check whether Access is enforcing domain integrity. Table 6.7 shows the initial entries for each employee of Northwind Traders. The dates are based on values in the Employees table's HireDate field. No Rating entries appear in Table 6.7 because ratings don't apply to newly hired employees.

Table 6.7. First Nine Entries for the HRActions Table

Employee ID

Action Type

Initiated By

Scheduled Date

Approved By

Effective Date

New Salary

HRComment

1

H

1

05/01/1992

1

05/01/1992

2,000

Hired

2

H

1

08/14/1992

1

08/14/1992

3,500

Hired

3

H

1

04/01/1992

1

04/01/1992

2,250

Hired

4

H

2

05/03/1993

2

05/03/1993

2,250

Hired

5

H

2

10/17/1993

2

10/17/1993

2,500

Hired

6

H

5

10/17/1993

2

10/17/1993

4,000

Hired

7

H

5

01/02/1994

2

01/02/1994

3,000

Hired

8

H

2

05/05/1994

2

05/05/1994

2,500

Hired

9

H

5

11/15/1994

2

11/15/1994

3,000

Hired

Entering historical information in a table in Datasheet view is a relatively fast process for experienced data-entry operators. This process also gives you a chance to test your default entries and Format properties for each field. You can enter bogus values that don't comply with your validation rules to verify that your rules are operational.

To add the first nine historical records to the HRActions table with the data from Table 6.7, follow these steps:

  1. graphics/opening_table_displays.gif Click the Datasheet button to return to Datasheet view, if necessary. The cursor is positioned in the EmployeeID field of the default first record.

  2. Enter the EmployeeID of the employee. Press Enter, Tab, or the right-arrow key to move to the next field and to add a new default blank record to the view but not to the table's content.

  3. Type H in the Type field or select H from the lookup list, and move to the next field.

  4. Type the numeric value of 1 or greater for the InitiatedBy field. (You need a value in this field for each employee because of the field's validation rule.) Move to the next field.

  5. Type the ScheduledDate entry. You don't need to delete the default date value; typing a new date replaces the default value. Then press Enter, Tab, or the right-arrow key.

  6. Type the ApprovedBy value and move to the next field.

  7. Type the EffectiveDate entry, and skip the HRRating field.

  8. Type the NewSalary of the monthly salary at the time of hiring, and skip the NewRate, NewBonus, and NewCommission fields.

  9. Type Hired or any other comment you care to make in the HRComments field. Move to the EmployeeID field of the next default blank record.

  10. Repeat steps 2 through 9 for eight more employees in Table 6.7.

graphics/power_tools.gif

When you complete your entries, the HRActions table appears as shown in Figure 6.10. If you skipped any of the example procedures in this chapter, an updated version of the Nwind05.mdb database with the data entered for you is in your \Program Files\Seua11\Chaptr06 folder. As mentioned early in the chapter, importing the HRActions table required adding a one-to-many relationship to the Employees table. If you don't add the relationship, some validation tests in the next section won't behave as expected.

Figure 6.10. The HRActions tables contains initial entries for the nine employees of Northwind Traders.

graphics/06fig10.gif



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net