Help! - Appending only the new records on one table to another tab

G

Guest

I am trying to automatically take the "badge number" fields on one table and
automatically have them added to the "badge number" fields on another related
table. I only want the new records entered in on the inital form to be added
to the secondary table. I already have the old records added.
 
J

Jeff Boyce

Why?

If you already have the values in one table, why are you trying to add them
into another table?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

I have an employee data information table and then an employee training table
that will calculate the precentages of those who have gone thru training as
well as lists those who have not. The main employee data information is used
and related to several tables along with this training table. In order for
our precentages to stay up-to-date every time a new employee is
added/deleted, I need that information to automatically be added/deleted to
the training table. When I created a relationship to cascade it would do
just what i needed to on the form for the traini ng but would not add the new
badge number to the table so i tried running an append query after new
employees are added to the employee information table. However, I don't want
it to try to add all the badge numbers every time, just the new ones entered
- otherwise i will always get an error message saying so many records can't
be added due to duplicates (which is fine that's what i want i just don't
want to see the error message all the time)
 
J

Jeff Boyce

It isn't necessary (and is somewhat undesirable) to have "empty" records in
a second table so as to be able to count who has NOT done something.

Instead, a simple query matching folks in the employee table with folks in
the training table also gives you a count of those who are NOT in the
training table.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

I am trying to automatically take the "badge number" fields on one table and
automatically have them added to the "badge number" fields on another related
table. I only want the new records entered in on the inital form to be added
to the secondary table. I already have the old records added.

What in your table identifies new records?

Are you trying to create empty "placeholder" records in a new table? If so,
don't; they're essentially NEVER necessary. Normally one would use a Subform
on the badge-number form to enter data into the related table; if you use the
badge number as the Master/Child Link Field it will fill in automatically when
you add data to the secondary table. It's not necessary to "preload" them.

John W. Vinson [MVP]
 
J

John W. Vinson

In order for
our precentages to stay up-to-date every time a new employee is
added/deleted, I need that information to automatically be added/deleted to
the training table.

Ummm...

No, you don't.

You need to correct your query to use a Left Join so that employees without
training records are handled correctly, without any need to create empty
records in the training table.

If you'll post the SQL of the query that calculates your percentages, someone
should be able to show you how this can be done.


John W. Vinson [MVP]
 

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