View Full Version : Linking columns in two tables?


mgtyper
04-19-2007, 12:42 PM
I have been able to link column A1 in Table A to Column B1 in Table B.
But I want to link Columns A2,A3,A4 to Columns in table B using A1 and B1 as the relationship. Can this be done??

Thanks

Dennisk
04-20-2007, 12:51 AM
yes - its called a compound key.

mgtyper
04-20-2007, 07:09 AM
Do you mean multible keys.
My column a need to link are not unique values, only columns 1 have unique values.

Dennisk
04-20-2007, 07:20 AM
I don't understand what you want to acheive. Are you referring to links in a query or relationships in the relationship window.

mgtyper
04-20-2007, 07:32 AM
OK , Sorry

I will esplain.

Lets say we have table of wheels and tires. The wheel column (key)has unique values no duplucates.This table is linked to a car table. When I change tire column I want it to change in the Car table as well.

Wheels Table

Wheels(key) tires
type1 p175
type2 p185
type3 p175


Cars Table

Cars Wheels tires

Fiat type2 p185
Focus type1 p175
Scoda type1 p175


I hope that helps

Ron_dK
04-20-2007, 09:30 AM
There are no columns in access, these are called fields.
Anyway, if you want to make changes in one of your tables thru a query you need to look for Cascade update related fields in your relationships.

Hth

mgtyper
04-20-2007, 09:39 AM
Chages thru a query??
I would like to make a changes in the table or does it have to be query.
When I try to use Cascade update it wants the main fields to have unique values. Or am I doing something wrong???


PS I have been able to link Field(column) from one table to an other but was not able to add fields(columns) associated to the first ???

The_Doc_Man
04-20-2007, 09:51 PM
When I try to use Cascade update it wants the main fields to have unique values. Or am I doing something wrong???

You are doing something wrong if it complains that you don't have unique values for relationship that has cascade ability.

To answer your question regarding the multi-field linking:

1. You cannot directly link a field in table A with 3 fields in table B.

2. You CAN link the concatenation of 3 fields in table B to a field in table A, but only through a complex query that is a non-traditional JOIN. In fact, you cannot use the JOIN keyword to do this (I think).

You are using spreadsheet terminology on a database, which many folks here would find objectionable. To me, it is an indication of where you have been, from where you are coming. If I read your position correctly, you are at very dangerous position - it is called "just enough rope to hang yourself."

I almost don't know where to begin here, but I'm sure you need to give up some concepts that you learned in Excel. Keeping them now will only slow you down or turn you in a wrong direction. Your issue with updates is only because making updates directly through a table is usually the slowest and least accurate method of doing anything. Also because direct table editing cannot be automated without lots of pain and suffering. Most of us aren't that diabolical. {Dang it, where did I put down my pitchfork?}