Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup table help!

Status
Not open for further replies.

Caryisms

Technical User
Oct 17, 2001
132
US
How do I create a form in which a data clerk can enter a number in one box and it inserts into another box the corresponding value? The two columns are contained in one table.
 
You might want to re-think this operation just a little bit, as there is an easy way to DO what you want, without having to resort to storing both columns in a table.

You obviously have a situation where one person's (the D/E/C) view of the data is a number like "42", but another person's view of the same bits is "LeftHanded Smoke Shifter"...

Don't store both values. Create ONE lookup table with two columns, the Number and the corresponding value. Create ONE column in your main table, that contains the NUMBER.

In Table design mode, click the LOOKUP tab of this number field. Set the Display Control to Combo box, the Row Source TYPE to Table/Query, the Row source to the 2-column lookup table, the bound column to 1 (assuming that the first column of your lookup table is also the number field), the column COUNT to 2, Column heads to NO, and column widths to .25" and 1" (wider if necessary).

When the field has the focus, a combobox will show with the numeric values and text values:
Code:
27 | Muffler Bearing
35 | Carburetor Pully
42 | Smoke shifter

etc.

You might also create a JOIN between the two tables, to establish referential integrity. Drag the number guy in the look up table to the number guy in the main table, and set the link (one to many). If necessary check on Cascaded updates and deletes (depends on your application).

If you need any other help, let us know.

Jim
Jim Hare
"Remember, you're unique - just like everonone else"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top