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

Importing a DBF data file to Access using VBA

Status
Not open for further replies.
Oct 22, 2001
215
US
I am trying to import data file into an existing table in Access using VBA. The following commands can import fine but it does not import to the existing table. If the table exists, it just create a new table with an incriment...like :Existing Table1
I just don't know why it does not import to the same table....

DoCmd.TransferDatabase TransferType:=acImport, _
DatabaseType:="Dbase IV", _
databasename:="c:\mydb, ObjectType:=acTable, _
Source:=data.dbf, _
Destination:="Existing Table"
Can any one help? Thanks in advance....
 
You need to delete the existing table before importing. Do you want to overwrite the existing table or do you want to append to it? If you want to append to an existing table and you don't know the name of the dBase file until run time you'll need to import the dBase file into a temporary table(that you delete before importing) then append to your existing table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top