Adding new records to several tables

  • Thread starter Thread starter lecoughlin
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
Back
Top