View Full Version : Copy data table to table


kentendresen
04-01-2003, 03:39 AM
I have two tables with the same fields and records in both.

When a user updates one of the tables I want the new data to be automatically copied into the other table. Is it possible, i.e when the user exits the database or close the form?

Regards, Kent

neileg
04-01-2003, 05:01 AM
Why? What is the point of having the same data in two tables?

FoFa
04-01-2003, 07:46 AM
neileg asks a valid question, but sometimes we are stuck with what we have.
You could on one of the update events manually (SQL INSERT) the form data into the other table.
You could add a binary (Yes/No) field to the main table and update it to true on every update, than when the application/form/whatever is exited run a query that updates/appends all those that are true to the other table, than reset the flags to false.
If it is not much data you could run a delete query and a full repopulation of the table upon exit.
Or you could blow away the duplicate table and do it with one.