txt file

shariefoo

Registered User.
Local time
Today, 21:24
Joined
Sep 29, 2003
Messages
65
Hi all,

How can i import a .txt file into access ? The feilds are seperated by a tab not a ","..

please help
 
You use File->get external data. Ther is a wizard there to guide you. Tab delimited is one of the options.

Fuga.
 
Thanx Fuga but i want it done automatically.

Like using Macros.

i tried useing Import Delimited in macro but it imported everything in one feild because they are not seperated by a comma.

Is there a way where i could tell access to seperate the feilds from tab ?
 
Yes, this is what i use. I use it as an on_open event, but of course you can have it as a button click event or what ever.
Code:
    DoCmd.TransferText acImportDelim, "your importspecification", "yourtable", "c:\yourdir\yourfile.txt"

In "your importspecification" you choose the right options for tab delimited etc.

Fuga.
 
Sorry, form_open is the name of the event.
Code:
Private sub form_open()
    DoCmd.TransferText acImportDelim, "your importspecification", "your table", "c:\yourdir\yourfile.txt"
end sub

Fuga.
 
Last edited:
Sorry but one last small Question

Good morning Fuga..

I am really sorry to bother you but one last Question.

WHat did you mean by "choose the right options for tab delimited" ?

Didnt get you on that.

Do u mean just write tab ?
 
Hi, Shariefoo.

There is a wizard you can use to import txt files. You will be given some options as to which character separates the fields. That´s when you choose tab.

If you click the advanced tab, you will be able to save your import settings (your importspecification), not only with the tab delimited but with field types etc.

So what I meant was (I realize I forgot to mention that) that you do one import manually to save an importspecification (with tab delimited).

Fuga.
 
THANX ALOT

Good morning Fuga.

Thanx Alot for the information. Thank you
 
If you haven't found anything that works already.

Check out the "transfertext" function under macros. I'm using this and it works great. Simple and effective.
 

Users who are viewing this thread

Back
Top Bottom