Solved

Import Text File into Acess using a macro

Posted on 1998-12-18
4
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

705 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