View Single Post
  #6  
Old August 31st, 2009, 04:18 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Populating foreign key fields?

Try reimporting the Excel spreadsheet, and add an Autonumber column. Repeat
the copy/delete column technique, but make sure that you save the Autonumber
column in each table. That is your link field. You will still need to
consolidate your data. The Customer table will be the table that you make
the autonumber the Primary Key. In the other 2 tables, change the datatype
from autonumber to Number (Long Integer). These will be your Foreign Keys.
In the relationships window link the primary key to each of the other
table's foreign key. Consolidate and clean up the data.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Susita" wrote in message
...
Thank you both for your response - but I have created this database by
importing all the data from one large Excel file. I then created the
three
tables by copying the excel spreadsheet into each table and then deleting
columns were not specific to the individual table. I want to begin to
query
and analyze the data but realized I needed the relationship links. So
these
tables are full of rows & columns of data. In my Sales table - I have the
Supplier Name (which corresponds to a column in the Supplier Table). So I
already have all this data and trying to link it all together. Hoping
there
I was a way to do it without entering a corresponding ID # for each and
every
row.

"June7 via AccessMonster.com" wrote:

Yes, Steve (see later post) got it right. I should have thought of the
form/subform relationship. So, correction to my previous post is that
with
this structure the foreign key will fill in.

June7 wrote:
If I understand your question, you enter the foreign key info when you
create
a new record. Example: You enter a new invoice, the foreign key will be
the
customerID that you will have to select.

I am attempting to learn Access via the demos - but still need help - I
am
setting up relationship between a Sales, Supplier & Customer tables.
When I
[quoted text clipped - 3 lines]
the foreign fields? There are quite a few customers - with many Sales.
. .
Please help -


--
Message posted via http://www.accessmonster.com