How to control behavior and appearance, define the vendor lookup, and define the product lookup.
The value of using field rules to populate a list is that the rules are associated with the data, and consequently, the rules automatically influence the way a form or browse displays the data. The following screen shot shows the Table Lookup Form with Type-In controls which display lists based on the Vendor and Product fields. These controls provide two operating modes:
The Lookups tab of the Field Rules dialog box shows how you configure the Vendor form field to produce a list of Vendor_Name field values, while storing the corresponding Vendor_No value into the Quote_Vendor_No_FR field.
The Table field defines the source of the list data.
The Source fields defines the data that is retrieved from the Vendor table. The Fill field specifies that the Vendor_No field is mapped to the Quote_Vendor_No_FR field of the Table Lookups table. The Display fields define whether the vendor fields are displayed on the form.
Since the user is selecting from a pre-defined list, the Allow Exceptions field selection is "Force closes match". This configuration does not use a popup window, so the Auto popup field is ignored. The Allow Maximize display field allows popup windows to maximize if the underlying form is maximized. In this context it is ignored.
The Lookups tab of the Field Rules dialog box shows how to configure the Product form field to produce a list of Product_Name field values, while storing the corresponding Product_No value into the Quote_Product_No_FR field. The Table field defines the source of the list data. The Filter field defines the relationship that must be satisfied to select a record from the Product table. The expression " product_vendor_no = table_lookups->quote_vendor_no " means that the Product_Vendor_No field equals the Quote_Vendor_No field in the Table Lookup table. The expression table_lookups->quote_vendor_no means that you are specifying the Quote_Vendor_No in the Table Lookups table. It is important to use this fully-qualified field definition. The reason is that the lookup is based on the Product table. The fields of the Table Lookups table are foreign to it.
Since the user is selecting from a pre-defined list, the Allow Exceptions field selection is "Force closest match". This configuration does not use a popup window, so the Auto popup field is ignored. The Allow Maximize display field allows popup windows to maximize if the underlying form is maximized. In this context it is ignored. The Table Lookups sample database can be downloaded.