can a new record be added to two 1-1 relational tables at once

G

Guest

I have several tables linked one to one with my main contact table. Can a
new record be automatically added to those tables when a new record is added
to the main table? If so How???????
I though that I knew but nothing I try is working. They are all one to one
and referential integrety and cascade delete and update are all checked.
I didn't think adding them manually would be a problem but my end users are
all complaining about remembering to do it and having to know the ID from the
main contact. Thanks for any help
 
R

Rick B

I did this once. To do so, I included all the tables in my query and built
a form using that query as the record source. Then, I included all the
fields from my main table in my form. I also added the key field (in my
case, EmployNum) from each of the related tables. I made this field
invisible. In my before update code for my visible EmployNum field, I
included code to copy that value to the invisible controls. This created a
blank record in each of the related tables.

Generally, this is not a really good idea. If your tables are 1-to-1 then
they could probably all be in one table. I did it because I really wanted
to separate some employee data and have more control over who could access
part of the record.

In any case, that scenario should help you.
 
G

Guest

why not use a subform within a form. When they add to the main table via the
form, the subform is visible on the form and you can require them to add the
necessary records to the related table before they exit the form.
 

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