Microsoft Office Tutorials and References
In Depth Information
Field Properties for Making Sure That Data Entries Are Accurate
Figure 2-8:
Lookup field
properties.
Getting list items from a database table
Before you can get list items from another database table, you might want
to define a relationship between the tables; it’s not required, but it’s
recommended. Later in this chapter, “Establishing Relationships between Database
Tables,” explains how to do that. Follow these steps to get items in a
dropdown list from another database table:
1. In Design view, click the field that needs a list, open the Data Type
drop-down list, and choose Lookup Wizard.
The Lookup Wizard dialog box appears.
2. Select the first option, I Want the Lookup Field to Get the Values from
Another Table or Query, and click Next.
Book VII
Chapter 2
You see a list of tables in your database.
3. Select the table with the data you need and click the Next button.
The dialog box shows you a list of available fields in the table.
4. Select the field where the data for your list is stored.
5. Click the > button.
The name of the list appears on the right side of the dialog box, under
Selected Fields.
6. Click the Next button.
Normally, lists are displayed in ascending order, but you can select
a field and click the Ascending button to reverse the order of the list.
(Note that the button turns into the Descending button.)
7. Click the Finish button.
If you’re so inclined, you can change the width of the list before clicking
Finish, but you can always do that on the datasheet, as Chapter 3 of this
mini-book explains.
Suppose that you obtain the items from the wrong field or wrong database
table? To fix that problem, select the field for which you created the list, and
in Design view, select the Lookup tab (refer to Figure 2-8). Choose Text Box
instead of Combo Box on the Display Control drop-down list and start all over.
Search JabSto ::




Custom Search