Presentation is loading. Please wait.

Presentation is loading. Please wait.

Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri.

Similar presentations


Presentation on theme: "Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri."— Presentation transcript:

1 Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri

2 Overview Validation Rules Lookup Fields Multivalued Key Foreign Key Referential Integrity

3 Validation Rules You have created, loaded, queried, and updated a database. To ensure the entry of valid data, Validation Rules are created. Validation Rules ensures that if a field requires an entry, it will be within a specific range or values.

4 To specify a Required Field Show the Navigation pane and then open the Student table in the Design View. Select the SSN Field by clicking its row selector. Click the Required property box in the Field Properties pane, and then click the down arrow that appears. Click Yes in the list.

5 Value changed to yes

6 Specifying a Collection of Allowable Values The only allowable values for Major are Visual Atrs, Cinema, Education, Music, Psychology, Physic, Zoology. For GPA the allowable values are 1 to 4.

7 Validation Rule Validation Text Major Field Selected

8 Validation Text Validation Rule Field Selected

9 To Save the Validation Rules Click the Save button on the Quick access Toolbar to save the changes. Click the NO button to save the changes without testing the current data. Close the Student Table.

10 No should be selected

11 Contd… If user enter a value that is different from the Validation Rules then the Validation Text will pop up with the Error Message.

12 Error Message

13 Invalid Entry

14 Creating a Lookup Field Click the Data Type column for the Client Type field, and then click the arrow to display the menu of available data types. Click Lookup Wizard, and then click the I will type in the values that I want. option button to indicate that you will type in the values. Click the Next button to display the next lookup Wizard screen.

15 Contd., Click the first row of the table and then type Education as the value in the first row. Press the DOWN ARROW key, and then type ZOOLOGY as the value in the second row. Press the DOWN ARROW key, and then type CINEMA as the value in the third row and so on… Click the Next button to display the next Lookup Wizard screen.

16 Click the Next

17

18

19

20

21 Multivalued Field Normally, fields contain only a single value. It is possible to have Multivalued Fields, that is, fields that can contain more than one value. For students who have double Major, we need Multivalued Fields since the Major Field will contain more than one value. To create a Multivalued Field, create a Lookup Field being sure to check the Allow Multiple values check box.

22 To Add a Multivalued Field The steps for adding a Multivalued Field is almost similar to creating a Lookup Field. Be sure to check the Allow Multiple values check box (Slide No 24).

23 Click the Next

24

25

26

27 Select Yes

28

29 Foreign Key A foreign key is a field (or fields) that is the primary key of an entity in another table. The purpose of the foreign key is to ensure referential integrity of the data. In other words, only values that are supposed to appear in the database are permitted.

30 Referential Integrity The property that ensures that the value in a foreign key must match that of another tables primary key is called Referential Integrity. In Access, to specify referential integrity, you must define relationship between the tables using the Relationships command. Access then prohibits any updates to the database that would violate the referential integrity. The type of the relationship between two tables specified by the Relationships command is referred to as a one-to-many relationship. This means that one record in the first table is related to many records in the second table but each record in the second table is related to only one record in the first table.

31 To Specify Referential Integrity Click Database Tools on the Ribbon to display the Database Tools tab. Click Relationships button on the Database Tools tab to open the Relationships window and display the Show Table dialog box. Import Professor.txt from course webpage and open and click the Professor table and then click the Add button to add Professor table. Click the Student table and then click the Add button to add Student table. Click the Close button in the Show Table dialog box to close the dialog box. Resize the field lists that appear so all fields are visible.

32 Contd Drag the Professor ID Number field in the Professor Table field list to the Recruiter Number field in the Client table list to open the Edit Relationships dialog box to create a relationship. Click the Enforce Referential Integrity check box. Click the Cascade Update Related Fields check box Click the Create button to complete the creation of the relationship. Click the save button on the Quick Access Toolbar to save the relationship you created. Close the relationship window by clicking the Close Relationships button.

33

34 Professor Table Selected Student Table Add buton dialog box

35 Field List for Professor Table and Student Table Prof ID Num Field in Student Table Prof ID Num Field in Professor Table

36 Enforce Referential Integrity selected Cascade Update Related Fields selected Create Button Prof ID Num Fields used to relate tables Edit Relationship Dialog Box

37 One part of the Relationship Many part of the relationship One Prof ID num is related to many Prof Id num Relationship Line


Download ppt "Access Manual 4 By Elham S.Khorasani Ismail Guneydas Dhawala Kovuri."

Similar presentations


Ads by Google