Docsity

The Lookup Wizard, Slides of Design

Partial preview of the text

Download The Lookup Wizard and more Slides Design in PDF only on Docsity!

Lecture four

THE LOOKUP WIZARD

By

Hadeel.M.Saleh

THE LOOKUP WIZARD

The Lookup Wizard creates what’s called a lookup column. The lookup column lets you

see the contents of a linked table so that you can pull info in directly from that table, rather

than having to type it out each time. Not only does this simplify data entry, it also cuts

down on typos and inconsistencies in how data is entered.

Let’s say you’ve created a Supplier table with a Supplier Name field. Next, you create an

Inventory table with a Supplier Name field in it. When you click on the Supplier Name

field in your Inventory Table, a combo box containing a drop-down list of all the supplier

names from the Suppliers table appears for you to choose from. Click on your choice and

the name appears in the field in the Inventory table.

NOTE: Should you later add names to the Supplier Name field in the Supplier table,

those names will then automatically appear the next time you click on the combo box for

that field in the Inventory Table.

To use the Lookup wizard, Choose Lookup Wizard… from the Data Type list in Design view . Choose I want the Lookup column to choose the values in a table or query. Select the table you want to use as your source table to link from and click Next. Click on the field you want to link to your table and then press > to move it into the Selected Fields window and press Next. To sort the listings, click on the down arrow by the first Sort Order  window and click on your field.

If the primary key field in a table cannot guarantee all unique entries (Last

Name field, for instance, in an employee table that lacks an SSN or GWid

field), you may set up an Auto Number ID field. Each entry is assigned its

own number (1, 2, 3 and so on). The numbers are meaningless in and of

themselves; they simply serve to provide each record with a unique

identifier. This minimizes the risk that the wrong record will be pulled into

another table by accident. If employee last name were designated as the

primary key, for example, there could be two or more people who share

the same last name. And the database operator wouldn’t clearly know

which record is the one to select.

To assign a Primary Key: When you create a brand new database, Access creates a blank table for you automatically, and they have generated an Auto ID field and assigned it as a primary key.

If you want to rename that field as something else and make it the primary key,  Click the Design View icon.

You’ll be prompted to save the table, if you haven’t already.  Assign it a name and press OK.

 Rename the ID field by clicking in it and typing over the existing text.  Click on the down arrow beneath the Data Type column header and choose the data type you are using for this field (usually Text ).

Field Properties in the Design view screen Field properties allow you to control even further how data is entered in the fields of your table. If, for instance, you’ve set a data type to Date/Time, you can dictate in Field Properties exactly how a date should be typed. For example, you may want all years to be typed out completely rather than entered using only the last two digits (2006, rather than 06).

Here are some of the more commonly used Field Properties:

Field property Use Field size (^) Limits how many characters/numbers you can type in an entry. Format (^) Sets a consistent pattern for how various types of data display. For instance, regardless of how a date is entered—with hyphens or slashes—it will appear uniformly as one way or the other. Pre-defined formats are not available for text fields. Input mask (^) Establishes a pattern for how non-calculated numbers—phone numbers, zip codes, SSNs, etc.—or dates/times are to be entered. For instance, you may choose a pattern in which the entry of years must include all four numbers (2008), rather than just the last two (08). Data entered incorrectly will be rejected. Caption The label for a field, used in place of the field name, where desired. Since field names are usually typed without spaces, you might choose to type the caption Phone Number to appear as a label in tables, forms, reports, etc., rather than the field name PhoneNumber. Required (^) Designate whether data entry is required or not in a particular field

Indexed (^) Marks the data in selected fields for faster sorting and searching. If you index a Last Name field, it will be quicker in a large database to search out that name from amongst all the records.

NOTE: Field properties may display down arrows with drop-down menu lists, or, in the case of input masks, you’ll be prompted to click on the Build button to the right of the window.