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.
 

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

Back
Top