Import Text file- Tab Delimited

crosmill

Registered User.
Local time
Today, 06:32
Joined
Sep 20, 2001
Messages
285
OK, this is what I've got

Private Sub ImportLevelOne_Click()
Dim FileName As String
Dim objFSO
Dim objFolder
Dim objFile

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\server\share\folder\")

For Each objFile In objFolder.Files

FileName = objFile.Path
DoCmd.TransferText acImportDelim, , "ImportedFiles", FileName, True
Next
End Sub


It would work fine if the file was comma delimited, but it's tab. It's not recognising tab as a delimiter, so it's concatenates all the column names and looks for a column in the db called "fistnameSecondnameAddress1....."

Can you specify the type of delimiter?

Cheers
 
transfertext delimited

Do the import manually and set up an import specification. Save the import spec ,where you have selected the type of delimiter. Then use that import spec in the transfertext action.
 
Cheers fuzz.

Got it sorted.
 

Users who are viewing this thread

Back
Top Bottom