The Lookup Wizard (I)

The lookup wizard


On some occasions, the value introduced in a column can not be of just any kind, but needs to be extracted from a list of valid values for this particular field. For example, the field Sex with the values M or F, a State field with values (FL, TX, NY, etc...). This list of values can be fixed values that we type or it can be a list of values extracted from an existing table in our database (for example from a table that contains all states).

In Access we can define this list of valid values easily and quickly using the Lookup wizard.

To start the wizard you will need to position yourself in the design window of the table over the type of data field that will contain the data extracted from the list and select Lookup wizard...


Next will appear the first screen of the wizard where we are asked whether we want to obtain the values of a specific table or query, or if we would like to write the values.

Search column based on a list of values.


 If we select the second option (I will type in the values that I want) a second screen appears where we need to indicate the values filling the column.



Once we have introduced all of the values press the Next> button to continue to the next screen where we can type a name for the column.

All we need to do now is click on the Finish button.



The Lookup tab - List of values.


With the wizard we have defined the field with a search list based on a list of values, we see this reflected in the fileds properties in Lookup tab in the following way.

The properties that appear will show us the folowing:

Display control: A Combo box, indicate we can type a value or we can click on the box to display the list and choose one of values.

Row source type: In our case its a list of values that we had introduced.

Row sourse: in this property we have the different values of the list separated by semicolons.

Bound Column: determines which column Access will get from the value to store in the field.

Column Heads: Determines whether a first line with column headers will appear in the drop down list. If this property contains the Yes value, it will take the first line of values as the column headings.

Columns Widths: etermines the width of every column on the list. If there are various columns widths will be separated by semicolons.

List Rows: determines how many rows are displayed when the list drops down.

List Width: indicates the total width of the list.

Limit to list: if this property contains No, we can introduce a value that is not in the list, whilst if we indicate Yes, the value needs to be one of those on the list. If the user tries to enter a value not contained in the list, Access will return an error message and will not allow this value to be saved.



Continue with advanced...

Legal warning: Authorised on-line use only. It is not allowed the use of these courses in companies or private teaching centres.
© aulaClic. All rights reserved. Reproduction in any form whatsoever is prohibited. April-2006.