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

Import Table into Database with existing Table Name

Status
Not open for further replies.

mtanner01

Technical User
Nov 20, 2001
34
CA
Hi,

I am fairly new at Access programming and am having a problem getting the following to work.

1. I need to be able to select a MS Access Database
2. Import a table (eg. Test Data) into the existing database's table with the same name (Test Data).
3. Would like this to work off of a button, as creating a Form for the various steps in the process.

I am trying to use a DoCmd.TransferDatabase but it keeps giving me errors. )o:

Any help would be greatly appreciated. Thank you in advance for your time and thoughts.

 

What options are you using with TranferDatabase? What errors are you getting when you run the code? Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Sorry for taking so long to respond, as was away for Holidays. The following is the line that I have in my Button Event:

DoCmd.TransferDatabase acImport, dlgFile.FileName, acTable, "Labor Import Work", "Labor Import Work"

My error message is 'run time error 13' type mismatch.

I am sure that part of my problem is that I am trying to select a random file. But mind you even if I name a file I get errors. Think this is a little beyond me.

Thanks.

 
I have been able to get this to work now, as had missed a comma (,) in one place. Plus found out that the database being created is Access97, so I need the option "Microsoft Access".

My only issue now is that I want to actually import this data into an existing database (note they have the same name)....any suggestions would be appreciated.

Thank for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top