Adding data to MtM

Z

Zilla

Hello,
I need a procedure to add a new table of data to an existing MtM
relationship which looks like:
Table1: students
Table2: Link
Table3: Classes

The middle table contains only the two ID (PK) fields from the Students and
Classes table which are both autonumber fields. The new data is coming on
excel format, and is a simple register detailing students and their classes.
When I append the student details to tble 1 it generates autNo. id's - but
how do I then get those id's into table 2 so they can be linked to the
classes table? the only method i can see (which is'nt somehow blocked by
referential integrity) is to literally copy and paste the generated ID's from
tbl1 into tbl2...but copy and paste is not really a satisfactory solution.

I can see that if i was entering the data one record at a time from a form i
would not have this problem, but its the fact that I need to add data in
chunks that I'm stuck on.

Any help appreciated
 
S

Steve Schapel

Zilla,

It seems to me that the problem is not because of importing multiple
records at a time. The basic problem is that you are using an
Autonumber ID field in the Students table. What is the purpose of this?
You must be able to uniquely identify each student in the imported
data, otherwise you won't be able to reliably do anything with it at
all. So what is the basis of this unique identification? This is what
you need to use to relate to the Link table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top