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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer table into another table but in different database 1

Status
Not open for further replies.

danielcan

Technical User
Jul 6, 2007
15
0
0
CA
Good day to you all.

I am currently in my last mile for my project. what would be the code or macro to saved the data I just entered in my table and to save it into another table in another database.

I hope that does not sound to confusing.
thank you
 
You can link the table from your other database/mdb into your current database/mdb. Then run an append query of your "data I just entered in my table" into your linked table.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Here is the SQL syntax for an append query to a table in an external database:
Code:
INSERT INTO [MS Access;Database=[i]filepath[/i];].[[i]table[/i]]
SELECT *
FROM [[i]table[/i]];

Example:
Code:
INSERT INTO [MS Access;Database=C:\MyFolder\MyExternalDb.mdb;].MyExternalTable (Field1, Field2, Field3)
SELECT MyTable.Field1, MyTable.Field2, MyTable.Field
FROM MyTable;

Example (password-protected external database):
Code:
INSERT INTO [MS Access;Database=C:\MyFolder\MyExternalDb.mdb;PWD=Mypassword;].MyExternalTable (Field1, Field2, Field3)
SELECT MyTable.Field1, MyTable.Field2, MyTable.Field
FROM MyTable;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top