Strange error when importing text (1 Viewer)

Fuga

Registered User.
Local time
Today, 18:05
Joined
Feb 28, 2002
Messages
566
When I import a text file using the wizard, it works ok.

When I want the same thing and use;

Sub import()
Dim dirname As String, nextdoc As String
dirname = ("c:\...\")
nextdoc = Dir(dirname & "*.txt")
DoCmd.SetWarnings False
Do While nextdoc <> ""
DoCmd.TransferText acImportDelim, , "tbl", nextdoc
nextdoc = Dir()
Loop
End Sub

the import doesn´t work. Apart from the occasional date, the rows only have a lot of 0´s in them.

First I included some queries in the loop, but I took them away since I thought they were the problem. The problem seems to be the importing itself.

Ideas?

Fuga.
 

Users who are viewing this thread

Top Bottom