Copying fields from one database to another database

  • Thread starter Thread starter Mo
  • Start date Start date
M

Mo

Hi,

I have two databases, DB1 has the fields Project Name and
Project Number. I would like to have these fields copied
over to DB2 on a daily basis.

Both of the databases are setup and contain the same
fields.

Could somebody please point me in the right direction as
to what coding i can use.

Thanks
 
In one of the databases (whichever is more convenient for you), set up a
linked table to the table in the other database. Create an Append Query that
will append the data from one table to the other. Next, run the append
query. The code to run an Action Query (append, update, delete, etc) is

CurrentDb.Execute "NameOfQuery", dbFailOnError

If you then want to delete the records from the first table, you could run a
delete query on that table. The dbFailOnError will return an error if the
Append fails and you could then choose to not run the delete query.
 
Back
Top