Microsoft Office Tutorials and References
In Depth Information
Adjusting the widths of lookup columns
to their best fit
8. Click the Next button.
In the dialog box that appears next, you select the field you want to store in the
table. You’ll store the CustomerID field in the tblContract table, because it’s the
foreign key to the tblCustomer table.
9. Click CustomerID in the Available Fields list box, and then click the Next button.
In the dialog box that appears next, you specify the field name for the lookup
field. Because you’ll be storing the CustomerID field in the table, you’ll accept the
default field name, CustomerID.
10. Click the Finish button, and then save the table.
The Data Type value for the CustomerID field is still Text because this field con-
tains text data. However, when you update the field, Access uses the CustomerID
field value to look up and display in the tblContract table datasheet both the
Customer and CustomerID field values from the qryCustomersByName query.
In reviewing contracts recently, Sarah noticed that the CustomerID field value stored in
the tblContract table for contract number 3030 is incorrect. She asks you to test the new
lookup field to select the correct code. To do so, you need to switch to Datasheet view.
To change the CustomerID field value:
1. Switch to Datasheet view, and then resize the CustomerID column to its best fit.
Notice that the Customer ID column displays Customer field values, even though
it’s the CustomerID field values that are stored in the table.
2. For Contract Num 3030, click Lily’s Boutique in the Customer ID column, and
then click the arrow to display the list of Customer and CustomerID field values
from the qryCustomersByName query. See Figure 5-34.