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!

What Is A Lookup Field? 2

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
It's described here:


I get the impression that a lookup field and a validation table are the same thing?

I just want to make sure that I'm not doing that if it's bad to do that...

In the database I'm currently working on, I have a main table that holds some ID's of other stuff in other tables. Best way I can describe it is:

Code:
tblMain          tblCars
--------         -------
AutonumberID  |--FavCarID
Last Name     |  FavCarType
First Name    |
FavCarID------
etc...

So the tables are linked that way, the ID is held in the main table, and the id corresponds to a person's favorite car. You just enter people's favorite cars in the tblCars and then they link back to the main table thru the ID.

Is that a Lookup field?

Thanks!!


Matt
 
The terminology tends to be used interchangably and you do have the right idea. A "lookup" or "validation" field is a field (usually in another table) that defines the legal values that a field may have. "Lookups" are usually a table-to-table relationship and are usually one-to-one ... meaning that a value in one table will match exactly one value in the other table.

"Validations" may be coded directly in the definition of a field in the table as a validation rule. For example
[blue][tt]
>= 0 AND <= 10
[/tt][/blue]
would restrict a numeric field to the range 0-10 but it doesn't involve any other tables. You could also have a validation like
[blue][tt]
IN ("A", "J", "P" )
[/tt][/blue]
that restricts a character string to those values and that one could be done with a lookup table as well.
 
Now if you want to allow users to select more than ONE favorite you would need to set up another table:

tblMainFavorites
MainID
FavCarID

and make the composite PK of MainID AND FavCarID



Leslie
 
I see... :) I gave you both stars for responding.

So I'm safe with the table system that I have. The 'lookup' table, as described, sounds a lot like the Dictionary Object from VBS.

And yes, if people were allowed to have more than one car I'd have to set up a table to allow the many-to-many relationship.

I just don't have all the terminology down quite yet. :)

Thanks for hte responses!

Thanks!!


Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top