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

Import Excel data into existing table

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
Access 2000. I am using the below code to import excel data and each time I do I drop the existing table SAP_Import first. I then run the transfer spreadsheet code to get the table back but I then loose my linked table connection to the server. How is it possible to import this data without destroying the table ? If I leave the existing table intact then run the import I get a different table name.

DoCmd.TransferSpreadsheet acImport, 8, "SAP_Import", "\\Administrator\Common\Production\AQA0PP_SCP_ABS_TARG_PRD2summary.xls", False, ""


 
I suppose the easiest would be to delete the data from SAP_Import, rather than dropping the table. Alternatively, you could relink programmatically.
 
Might you have any examples of how to programmatically relink this table with VBA code ?

Thank you for the response.
 
TransferDatabase can be used to relink a table. I am not quite sure what link you are losing, so I cannot be more exact.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top