Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer data from one Access Dbase to another

Status
Not open for further replies.

realflava

Technical User
Apr 11, 2004
16
DE
I am trying to transfer data from one Access Database to another. The tables strucutre is exactly the same.

I am using a Macro command 'TransferDatabase' but it doesn't update the 'data' in the specific table.. but creates a completely new table.

Is it possible to only import the data without Access creating a new table in the destination database?

thanks!
 
realflava,
The TransferDatabase command either transfers a complete table, or an empty table (structure only).

What you apparently want to do is an append query. There are several ways to do that, but the easiest is probably to just use the DoCmd.RunSql. Like so:

Link the destination table:
File|Get External Data|Link Table

In your sub or function:
Dim strSQL as String
strSQL = "Insert into <destination table name> select * from <source table name>"

DoCmd.RunSql strSql

That's it.
Tranman
 
Tranman - thanks alot for that, simple code that works well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top