importing access tables into an access db

A

Amanda Kelly

I have the following code for a click event on a command button:

Private Sub Command86_Click()
On Error GoTo err_command10_click

Dim strfile As String


strfile = InputBox("Please enter the full path and file name including the
extension of the Access database that contains the data to be imported.")


DoCmd.TransferDatabase acImport, "Microsoft Access", strfile


exit_command10_click:
Exit Sub

err_command10_click:
MsgBox Err.description
Resume exit_command10_click

End Sub

---------------------------------------------

i get an error message that says "" The Microsoft Jet database engine could
not find the object ". Make sure that the object exists and that you spell
its name and path name correctly."

I am copying and pasting the properties of the file (path and name) directly
out of the directory into the input box. So I cannot be mispelling it.

Any help would be graciously appreciated...


Thanks,
 
D

Douglas J. Steele

The TransferDatabase method requires a few more parameters: you must specify
what type of object you're importing (acTable in your case), the name of the
object in the source database and the name you want to use for the object in
the destination database. You also have a choice of specifying if you want
only the table structure imported without its data.
 

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

Top