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

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

Using Lookup Fields in Tables

Access 2003’s lookup feature for table fields lets you substitute drop-down 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 lookup feature automatically enters the value 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 exist 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 the CompanyName field value from the Customers table in a drop-down list. The EmployeeID field displays the LastName and FirstName fields of the Employees table, separated by a comma and space (see Figure 11.19).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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