469,159 Members | 1,504 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,159 developers. It's quick & easy.

Access 2 Fields Relationship

Hi and thank you for reading this,

I have 2 tables. On Table1 and on Table2 I have 2 fields (one where I define a name of a movie theater as string and the other one where I define the # of the screen of that movie theater). How can I make a relationship taking into account both fields (columns)?

Note: please take into account that I do not want to create a new field to concatenate those 2 fields.

Thanks in advance!
Oct 5 '11 #1
1 1304
32,167 Expert Mod 16PB
From that position you can't Miguel. It sounds like you're a little confused as to how this works so I'll try to lay down some basic guidelines :
  1. Start with two tables. In this case I suspect you have one table for theatres and a separate one for screens. For our purposes we'll call the [tblTheatre] and [tblScreen].
  2. Each table should have a unique Primary Key or Index (PK), but far better not a text field. Names or descriptions are particularly worth avoiding due to the problems they can introduce, as well as the extra overhead/delays introduced to handle larger amounts of data (An AutoNumber or Long Integer field takes up eight bytes for each entry).
  3. When linking these two tables together, and this will normally be done using a one-to-many relationship, it is necessary for one of the tables to duplicate the key of the other. That is to say the second table ([tblScreen] in our case) would contain a field that matches the PK of [tblTheatre]. It would also have it's own separate PK, which again should preferably be a Long Integer field.
  4. A match is determined by having the same [tblTheatre] PK value in both the PK of [tblTheatre] as well as the matching Foreign Key (FK) of [tblScreen].

I hope that clears the issue up for you Miguel.
Oct 5 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.