import a table from a database into another database

Jon123

Registered User.
Local time
Today, 08:02
Joined
Aug 29, 2003
Messages
668
Can I use a command button on a form to copy a table from a database that is not opened into the database that is opened? If so how?

thanks

jon
 
Can I use a command button on a form to copy a table from a database that is not opened into the database that is opened? If so how?

thanks

jon

jon,

It is possible to do. I would use:

Code:
DoCmd.TransferDatabase acImport  ...

Check the help file for the complete syntax
 
this is what I have
Code:
DoCmd.TransferDatabase acImport, "Checklist", "C:\Path\Database1.mdb", acTable, "Checklist"

I'm getting an error Run Time
Doesen't support the operation you chose?
 
got it needed to add

DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\path
 
This is really very good. And how can we make access to ask the path every time?
 
Could also use an input box, but then they would have to know the exact location of the database.
 
I have an example:

Document Links
First of all, I'ld like to thank you very much for your help. So all I have to do, is to take the form of the example and instead of view file, I make it import, by changing the command in this!?

Dim retval As Variant

If Me.DocPath > "" Then

retval = DoCmd.TransferDatabase acImport, "Microsoft Access", "Me.DocPath", acTable, "name of table"
Else
MsgBox "There is no file to view."

End If
 

Users who are viewing this thread

Back
Top Bottom