Adding new records to several tables

L

lecoughlin

I have several tables in my database that have the same primary key,
"site_id." I am constantly adding new sites to the database, so I am
trying to figure out a way to streamline the process. As I add
additional sites, I would like new records to be created in several
other specified tables. I'd like to avoid having to create a new
record by hand in each table, each time I have a new site.

Can anyone help point me in the right direction? Thanks.
 
R

RBear3

If you include all the tables in your form's record source, you can then
create invisible fields on your form that store the "site_id" for each table
and have it filled in. Build code in the main (visible) site_id control on
your form that fires after update. Have it copy that value to the other
invisible fields on the form.
 
P

Pat Hartman \(MVP\)

If you are having to create "dummy" records in other tables, you have a
design flaw. Perhaps the problem will be solved by changing your join from
inner to left. That will handle missing rows in the "child" table.
 
L

lecoughlin

I'm not sure I understand. Right now (for example) I have 2 tables,
one that has information about population, and the other has
information about address. The primary key for both tables is
"site_id." If I add a new site_id to the population table, I would
like to automatically create a new record in the address table that
contains the new site_id.
 
P

Pat Hartman \(MVP\)

Why do you have two tables? It would seem that one table would suffice.
 

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