How do I enter the same record on two tables simultaneously?

N

NAguilu

I have two tables that are related. I would like to find a way that if a key
that is on the first table is not on the second, a new record would be
automatically created with the missing key in the second table.
 
R

Rick B

Why? Do you have a one-to-one relationship?

If you have a one-to-many, you should have your main table as the forms
record source, and your related table (many) as the source of your subform.
Then, you'd create a main record and one or more related records.
 
O

Ofer

Most important, Back up your data first
========================================
Using the Query wizaed, create an UnMatch records query, that return the
records that are in table A but not in table B, link by the key, and display
return the Key field.
When you get the desire resault, change this select query to append query,
and append all the missing records in table B
========================================
Or, if you want to append only one field, key field, just run an append
query on all the records, it will skip the records that already there,
because of violation of primary key, so you end up with the new records only
in table B
 
J

John Vinson

I have two tables that are related. I would like to find a way that if a key
that is on the first table is not on the second, a new record would be
automatically created with the missing key in the second table.

It's almost NEVER either necessary or beneficial to create such an
empty "placeholder" record.

Could you explain why you wish to do so, and why it wouldn't be
acceptable to do the usual thing - enter data into the second table
using a Subform, which will automatically fill in the ID when (and
only when) there is data added to the second table?

John W. Vinson[MVP]
 
Top