473,666 Members | 2,120 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 1357
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
............... ............Tab le2
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 patientins_info ( PatientInsurance Information)
0
2634
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
1438
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 specify the columns in question as not null and this will produce an ExecInsert error if the data is not present in my insert. However, it seems to me that it would be better to be able to rely on
0
1316
by: David Allison | last post by:
Foriegn Key Required - Yes - no wonder it didnt work. Now they tell me. -- Dave Allison
0
2014
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 the truncating of the Parent table will effect the keys? Would all I have to do is insure that I vacuum the db after I truncate and repopulate the table? ----------
4
1694
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 investor, and in the sub form, I have created investory foreign key, this is the second link between main form and subm form.
2
3797
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? Type ----------------------------------------- -------- ---------------------------- FNAME VARCHAR2(10) LNAME VARCHAR2(10) SSN ...
1
1163
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), Customer_Last_Name varchar(75), Address varchar(100))
1
1174
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 replies....... thanking you..
0
874
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
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8642
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5666
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
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.