Importing from one databse into another

LWCARAB

Registered User.
Local time
Today, 12:17
Joined
Jan 29, 2008
Messages
38
Hello,

I need to import the data from one database into another everytime a form opens, I have some code which works:

Function GrabAccessTable()
DoCmd.TransferDatabase transfertype:=acImport, _
databasetype:="Microsoft Access", _
databasename:="\\trigger\wwwroot$\AW@RD\AW@RDOnline.mdb", _
objecttype:=acTable, Source:="Main", _
destination:="Table", structureonly:=False
End Function


The problem is that it won't surrently write it into an existing table, I want it to write into a table called Table (stupid choice of name I know....) but instead it creates a new table calle Table1.

Thanks

Richard
 
The database transfer transfers the whole object (in this case the table), if you just want the data, you can create a linked table in your current database. That way the data is available in your current database just like any other table. You do not need to even import the records.
 

Users who are viewing this thread

Back
Top Bottom