Locked lesson.
About this lesson
Control the information entered into a field by creating a drop-down list using the Lookup Wizard.
Exercise files
Download this lesson’s related exercise files.
3.03 lookup-wizard - Exercise.docx44.1 KB 3.03 lookup-wizard - Exercise solution.docx
53 KB TechGurusTicketing04.accdb
540 KB TechGurusTicketing04 - Complete.accdb
552 KB Trip_Example.txt
361 B
Quick reference
Using the Lookup Wizard to Create a Drop-down List
In this lesson, we will add the Priority field to the table and control the information that can be input by creating a drop-down list using the Lookup Wizard.
When to use
Use the Lookup Wizard whenever you want to control the information users can enter into a field.
Instructions
The next field to add to the table is 'Priority'. The priority for this ticket is 'Low'. We are going to create a combo box so users can select a priority from a drop-down list of items.
We can create a drop-down list using the Lookup Wizard which will guide us through the process.
Creating a Drop-down List Using the Lookup Wizard
- From the Home tab, click Views and select Design View.
- Add a new field for 'Priority'.
- Click in the Data Type field and select Lookup Wizard from the list.
First, how do we want the lookup field to get its values? Do we want to get the values from another table or query or do we want to type the values?
- Select I will type in the values that I want.
- Click Next.
Now, let's choose the number of columns for our list. We only need one column to list the activity levels.
- In the Number of columns box, type 1.
- Type the list values, 'Low', 'Medium', and 'High'.
- Click Next.
Next, what label do we want to use for the lookup field? By default, the field name will be used.
- Type 'Priority' as the lookup field label.
Do we want users to be able to type other priorities outside of the list items? No, we don't. Users should only be allowed to select values from the drop-down list.
- Check the box, Limit to List.
Now, do we want to allow users to select multiple values from the list? No, we don't. They are limited to only one selection. Leave the checkbox de-selected.
- Click Finish.
Finally, add a description for the field.
- Click in Description and type 'Priority for this ticket'.
Defining the Lookup Field Properties
Now we have created our drop-down list, we need to define the properties for this field.
- Change Field Size to 40 chars.
- Change Required to Yes.
- Change Allow Zero Length to No.
- Change Indexed to Yes (Duplicates OK).
As this field is set up as a lookup, we have an additional tab called 'Lookup' where we can define the properties specifically for the drop-down list.
- Click on the Lookup tab in the Field Properties area.
- Review the settings.
Display control defines the type of lookup. In our example, we are using a Combo Box.
The Row Source Type defines where we are getting the values that populate the list from. We created our own list by typing the values.
The Row Source lists the values in the drop-down list. We can manually modify these and even add extra items to the list by modifying the text. Each value must be contained within quote marks ("") and separated with a comma (,).
- Click in Row Source and add the value "Low - Medium".
- Change Limit to List to Yes.
- Change Allow Value List Edits to No.
Adding a Priority to Each Record
Now we've created a new field and set the properties, we can go back to our records and add the priority information for our ticket.
- From the Home tab, click Views and select Datasheet View.
- If prompted to Save, click Yes.
At this point, Access might pop up a data integrity warning message. In general, we only need to check this once we have finished creating our database.
- Click Yes on the message.
- Click Cancel on the next message.
Notice we now have a new column called 'Priority'.
- Click in the Priority field for the first ticket and select Low from the drop-down list.
Adding More Fields
Let's add two more fields to the table.
- From the Home tab, click Views and select Design View.
- Add a new field for 'Technician'.
- Click in the Data Type field and select Short Text from the list.
- Add a description.
- Add a new field for 'Description'.
- Click in the Data Type field and select Long Text from the list.
- Add a description.
Defining the Lookup Field Properties
- Select the 'Technician' field.
- Change Field Size to 40 chars.
- Change Required to Yes.
- Change Allow Zero Length to No.
- Change Indexed to Yes (Duplicates OK).
- Select the 'Description' field.
- Change Required to Yes.
- Change Allow Zero Length to No.
- Change Indexed to No.
In general, long text fields are not indexed.
Login to downloadLesson notes are only available for subscribers.