473,511 Members | 14,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you make a foriegn key in access????

56 New Member
Can some one refresh my memory on how to go about setting up a Foreign Key in Access. It has completely escaped me.

Thanks,
Sophie
May 21 '07 #1
4 1351
JConsulting
603 Recognized Expert Contributor
Can some one refresh my memory on how to go about setting up a Foreign Key in Access. It has completely escaped me.

Thanks,
Sophie
Table2
Table1 ID
ID----------------->Table1ID (ForeignKey)
Data Data
Data Data
Data
May 21 '07 #2
JConsulting
603 Recognized Expert Contributor
Can some one refresh my memory on how to go about setting up a Foreign Key in Access. It has completely escaped me.

Thanks,
Sophie
that sure didn't draw right :o)

basically if you have a main table that you consider the ONE in a ONE to Many relationship...it's ID would be used in the MANY table

The main table would probably be an autonumber index field....but in the Many table, it would simply be a number.

Then when you build your relationships, you draw your line from the ID of the main table, to the Foreign key of the Many table.
J
May 21 '07 #3
JConsulting
603 Recognized Expert Contributor
Table2
Table1 ID
ID----------------->Table1ID (ForeignKey)
Data Data
Data Data
Data
...........................Table2
Table1 .................ID
ID----------------------->Table1ID (ForeignKey)
Data ...................Data
Data ...................Data
Data
May 21 '07 #4
scolivas
56 New Member
Figures it is what I have been doing - nomenclature escapes me alot....Thank you so much.
May 22 '07 #5

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

Similar topics

0
632
by: Girish Agarwal | last post by:
Hi All, I have a database consisting of 2 tables. patient_info ( Patient Information ).Looks like lastname VARCHAR(10) fname VARCHAR(10) ssno INT(9) PRIMARY KEY ID INT(4) AUTO_INCREMENT ...
0
2620
by: Girish Agarwal | last post by:
--0-474210375-1058976151=:31789 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Note: forwarded message attached. __________________________________
1
1433
by: Bob | last post by:
Hi, Does anyone know why forgein key constraints are not enforced when updateing multiple tables using a combination of views and rules? This doesn't seem to be a major problem as I can...
0
1307
by: David Allison | last post by:
Foriegn Key Required - Yes - no wonder it didnt work. Now they tell me. -- Dave Allison
0
2008
by: Dev | last post by:
Hello all, I have a database system in which i truncate a main table to update the information. I would like to setup some foriegn keys referencing back to that table but am concerned as to how...
4
1688
by: irfi | last post by:
Hi, I am a form which has a sub form, The sub form is linked with primary key of main form as a foriegn key in sub form, very basic, In the main form, I have another field which is...
2
3783
by: raghunana | last post by:
hello friends, i am a beginer.I was unable to add a foriegn key constraint to my NAMES table which refers my EMPLOYEE TABLE SQL> desc employee Name Null? ...
1
1149
by: nads707 | last post by:
i hav following 2 tables n i am able to insert data into the second table having a foriegn key create table Customer_Details( Customer_ID integer primary key, Customer_First_Name varchar(75),...
1
1167
by: srinivaspnv21 | last post by:
hi every one, plz help me out in setting primary key and foriegn key to tables in sql server 2000 and brief description on it or any article u have plz send me...... waiting for u r...
0
870
by: chets92 | last post by:
sir can u give me an example (simple code) of how to use primary key and foriegn key queries...ie if i delete the primary key item the result should be reflected in other forms....
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.