Solved

Import Text File into Acess using a macro

Posted on 1998-12-18
4
423 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
ID: 1971543
Edited text of question
0
 
LVL 8

Accepted Solution

by:
Helicopter earned 100 total points
ID: 1971544
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
ID: 1971545
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
ID: 1971546
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

821 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