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

Ques on TransferSpreadSheet command

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
Does anyone know of a way to import a .csv file into an Access 2000 table (actually a SQL table using Access as a front end) the same way the TransferSpreadSheet command imports a .xls file? Would like to do this via VBA code, not via the import file method (i.e. File|Get External Data|Import..) from the menu bar.

Thanks for any assistance you can offer.
 
Do it once using the menu system, and be sure to remember or write down your actions.

Then, look at the import action for text files, and you should have all the info you need from doing the import once manually with the menus. Maybe, if you are like me, you might have to do the manual import twice to get all the parameter you will need for the VBA code.

Good luck,
Vic
 
use the TransferText method of DoCmd: expression.TransferText(TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage)
DoCmd.TransferText acImportDelim, ,"tblReport", "C:\Txtfiles\April.csv
 
macroCharlie: That's it! TransferText is the command that I needed.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top