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

VBA Code to Import Text Files 2

Status
Not open for further replies.

Hattrick16

Technical User
May 6, 2005
17
0
0
US
I want to import text tables into an Access DB, The files will always be in the same directory as the Access DB. The DB is an application to be copied by the enduser to thier part of the network with the proviso that the data files are put in the same DIR.

The Do command requires a hard coded path so this is not a viable option.

How would you write this code?
 
docmd.transfertext and currentproject.path...

--------------------
Procrastinate Now!
 
Thanks Crowley16

Can you provide me with a little more detail as I am a beginner. A code sample would be helpful
 
This should help hopefully.

DoCmd.TransferSpreadsheet acImport, 8, "Name of file", "The path of where to find the file", True

The 8 stands for the type of file you want to import, 8 for example relates to a .xls file type. And True is whether field names are included or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top