Solved

Import Text File into Acess using a macro

Posted on 1998-12-18
4
421 Views
Last Modified: 2006-11-17
I have a macro to import a text file into Access. I am using the Transfer Text Action in the macro section. Under Transfer Type I have chosen the Import Delimineted Type.
The .txt file I am importing must be a | (pipe or pike?) delimeted file. When it imports to a new table, all the columns from the text file remain in Field 1 of my table, all seperated by the | symbol. how can I have my macro specify the | type for the delimeted function.
The obvious solution of changing the text file to a file type such as Excel will not be possible in this case.
0
Comment
Question by:Lanscaper
  • 2
4 Comments
 

Author Comment

by:Lanscaper
Comment Utility
Edited text of question
0
 
LVL 8

Accepted Solution

by:
Helicopter earned 100 total points
Comment Utility
Run the import wizard once (file/get external data/import, select a txt filename, any one will do since you don't need to use the results) and set the delimiter to the |(select advanced on page 2 of the wizard) then save that import specification as a given name. Then in your macro select this name as your import spec.
 
 
 
   
 

0
 

Author Comment

by:Lanscaper
Comment Utility
You are exactly right. I must admit, I found the same answer through trial and error and using the help files. However, I still feel this was a challenging subject. Thank you for your response.
0
 

Expert Comment

by:rdc092298
Comment Utility
I have tried to perform it with a macro and a import specification but it still doesn't work. I'm using Office 97.

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now