INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Which value to store in main table from lookup table.

Which value to store in main table from lookup table.

(OP)
Hello,

I have a main table called tblproperties

It has a field TYPE

The values for the TYPE field come from a table called tblPropertyTypes

When storing a value in the field TYPE, I can either store the actual Value (i.e. house, flat etc) or the primary key of the table tblPropertyTypes.

I am not sure which is best:

If I store the actual Value, for example Flat and later wanted to change the wording from Flat to Apartment I would have to update all previous records. Otherwise if I just stored the primary key i.e. 2, it would save the updating, but be less clear at table level, during queries etc...

What is the best way to approach this?

Many thanks Mark

RE: Which value to store in main table from lookup table.

Hi,

If the terminology for any TYPE can change, without a doubt, store the KEY!

RE: Which value to store in main table from lookup table.

(OP)
I see that if I enforce referential integrity and cascade updates the values
Automatically update. This way I can store the value and if the value in the
Lookup table changes it applies the changes to the main table.

Bearing this in mind, do you think it is still better to store the key?

Many thanks for your early reply.

Mark.

RE: Which value to store in main table from lookup table.

That's what I'd do. But I'm more of a database user than a designer.

I'd defer to one of the MVPs in this forum.

RE: Which value to store in main table from lookup table.

IMO, always use the primary key value. Also, [Type] is a bad name for a field. I would think it would be easier to understand and maintain if you used [PropType] or similar.

Duane
Hook'D on Access
MS Access MVP

RE: Which value to store in main table from lookup table.

(OP)
Many thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close