PDA

View Full Version : Access insert into two tables



zugzwang
02-01-2011, 02:12 PM
I have a situation requiring inserting a record into one table (contact information), retrieving the index key from the new record and including it in an insert statement for a second table (event participation).

Table Contact - ID, Surname, Title...
Table Participants - ID, contact.ID, role...

On my form I want to allow select from existing contacts (easy - I can do that) or allow add a new contact record inserted if the contact does not exist and capture the new contact record ID for insert statement into Participants.

I am having a mental block, this should not be hard to do

Anyone have a sample showing how to do this?

OBP
02-02-2011, 08:00 AM
It is obviously possible using VBA, but why bother, it is normal to do this using a Main Form and Subform where the Master/Child Links take care of the updating of the subform and table.