473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to link data in two tables

I have completely forgotten how to do this. I have two tables, we will call them table 1 and table 2.
Table 1 has the fields

ID
Model
Brand
NumberOnHand
DateOrdered

Table 2 has the fields

ID
Model
Jan
feb
(and so on)


The data in the ID and Model fields of both tables should be corresponding. The Model field in table 1 has data in it, so how do I link the Model field from table 2 to table 1, so I don't have to go through and put in the data myself every time something gets changed. I know it has to do with foreign and primary keys, I have just drawn a blank on how they work. Thanks in advanced.
Mar 7 '07 #1
2 4499
Go to "relationships" under the "tools" button on the main toolbar. Click "edit relationship" on the relationship button. Then click "create new" and select the two variables that you want to link (which should be primary keys... I think). Then click "enforce referential integrity" and the other two options that are right underneath that.
Mar 7 '07 #2
the ID fields for both tables should be primary keys and (best Pactice) AutoNumber data type.
Table2 should then have a foreign key numeric data type which holds the corresponding number from the Primary key [ID] in Table1. create a one to many relationship between Table1 and Table 2 in Relationships view by dragging [ID] from Table1 to the foreign key field in Table2. Tick cascading updates and deletes if required and yuo're done.
Bon Chance.
Andy.
Mar 7 '07 #3

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

Similar topics

1
by: Lothar Armbr?ster | last post by:
Hello out there, this morning I had to get some rows via flashback query. Since my undo retention is just 3h, the undo segments were already aged out. But I have a physical standby database that...
2
by: scott | last post by:
Hi all First off, thank you for any one that can help. I have a problem trying to link a DataGrideTableStyle to a DataGrid. I have a dataset which reads from a file a xml schema and a xml...
3
by: debbie | last post by:
I have an Access 2002 program that I install using Wise. The first thing my program does when a front end is opened is re-link, then it checks the version and if needed upgrades the backend. My...
0
by: RLN | last post by:
I have a Microsoft Access2002 database that needs to connect to an Oracle Database. I need to map 2 tables from the Oracle DB to retrieve the proper data. I read somewhere (quite a while back)...
7
by: Lisa | last post by:
I have an Access 2000 application that uses the following function to re-link my tables when I switch from my Current back end to a Dummy back end. I also use it to refresh my links. Function...
1
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
1
by: amygrant1701 | last post by:
Hi, I've done this before so I don't see what I could doing wrong here. I'm running mysql 5x on freebsd. I'm using the default data directory of "/var/db/mysql" In there I have several dozen...
6
by: Matt | last post by:
Hi All, I have found a version of my answer on GG, but I have not been able to find my exact answer, thus the post. I am using Access 2000 Situation: I have a multi user frontend database...
5
by: edwardwill | last post by:
My client has a mission-critical application that was written in Microsoft Access sitting on a SQL Server database. It is basically a Quotation management system. The client wishes to install CRM...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.