• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Creating Multitable and Cros... > Using Lookup Fields in Tables

Using Lookup Fields in Tables

Access 2000's lookup feature for table fields lets you substitute dropdown list boxes or list boxes for conventional field text boxes. The lookup feature is a one-to-many query that Access automatically creates for you. The lookup feature lets you provide a list of acceptable values for a particular field. When you select the value from the list, the value automatically is entered in the field of the current record. You can specify either of the following two types of lookup field:

  • In a field that contains foreign-key values, a list of values from one or more fields of a related base table. The purpose of this type of lookup field is to add or alter foreign-key values, preserving relational integrity by assuring that foreign-key values match a primary-key value. A relationship must preexist in the Relationships window between the tables to define a field as containing a foreign key. As an example, the Orders table of Northwind.mdb has two foreign-key fields: CustomerID and EmployeeID. The lookup feature of the CustomerID field displays in a dropdown list the CompanyName field value from the Customers table. The EmployeeID field displays the LastName and FirstName fields of the Employees table, separated by a comma and space (see Figure 10.13).

    Figure 10.13. A lookup field's dropdown value list.

  • In any field except a single primary-key field, a list of fixed values from which to select. Field lists preserve referential integrity by restricting to primary-key values choices of foreign-key field values.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint