updating primary key values in one table using another table (1 Viewer)

M

michaeluk

Guest
Hi all, I am trying to create a simple course booking system where by users are presented with a form that they fill in their details and select from a course and two fields from these details are stored in one table.

I have a delegate table that uses an autonumber DelegateID for each individual as we don't know any information about the individuals and we dont know how many will enrol for the courses.

Also have a another table called event. There will be 25 events all together, therefore the primary key for the table is eventid which is a textvalue using numbers 1-25 the rest of the columns in this table consist of course code details and location codes etc
so eventid 5 = course 1 at location 10 on 20/01/2006 etc etc

The thirs table is the link table that is DelegateEvent which has a compound primary key of DelegateID and EventID so that you know which course the delegate is matched upto by matching id against courseid.

I have set the 1:M realtionship for both tables and have set referential integrity as well.

I have created a form to ask for this information about the user using the access wizzard and selecting the fields as neccessary. If I enter the details and then move onto the next record this does work and I am able to enter several people with each person having their own row and the autonumber does increase. However the autonumber values (DelegateID value) do not get copied accross into the EventDelagate table (which as per above has a compound primary key, part of which is DelegateID) and instead the fields for this column are blank even tho several rows have been created in the delegate table.

The same thing also happens when the user selects a course from the form, I would have thought that the courseid will be inserted into the EventDelegate table to match up with the memberid but the values don't get carried through into the linking table.

Do I need to create some more sql code for this to happen or what do I need to do to get data values to also appear in the linking table?

Many thanks for any help/suggestions/ideas etc,
Michael
 

Users who are viewing this thread

Top Bottom