• 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 97's lookup feature for table fields lets you substitute combo (drop- down list) boxes or list boxes for conventional field text boxes. 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 is provided. 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 combo box 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.15). The foreign key lookup feature is implemented by a simple Access SQL select query, SELECT DISTINCTROW [CustomerID],[CompanyName] FROM [Customers] ORDER BY [CompanyName];, in the case of the CustomerID field.

  • With any field except a single primary-key field, a list of fixed values from which to select is provided.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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