DaddyNackers
Programmer
I need some help....
I want to import a text file using VBA code. The text file is a fixed format (each field I want to allocate a specfic number of characters).
How is this possible?
This is some of the code I have already written...
--------------------------------------------------------
Dim tdfLinked As TableDef
Dim strTable As String
Dim strConnect As String
strConnect = "TEXT;DATABASE=K:\SCMLOGISTICS\FCST ACCURACY\ADMINISTRATION\INPUT FILES;"
strTable = "SourcingX"
Set tdfLinked = CurrentDb.CreateTableDef(strTable)
tdfLinked.Connect = strConnect
tdfLinked.SourceTableName = "SOURCING.TXT"
CurrentDb.TableDefs.Append tdfLinked
--------------------------------------------------------
I know that the code I have written is for linking a file to an Access database. I really would like to just import it.
Any help is much appreciated!!
Thanks,
Mike
I want to import a text file using VBA code. The text file is a fixed format (each field I want to allocate a specfic number of characters).
How is this possible?
This is some of the code I have already written...
--------------------------------------------------------
Dim tdfLinked As TableDef
Dim strTable As String
Dim strConnect As String
strConnect = "TEXT;DATABASE=K:\SCMLOGISTICS\FCST ACCURACY\ADMINISTRATION\INPUT FILES;"
strTable = "SourcingX"
Set tdfLinked = CurrentDb.CreateTableDef(strTable)
tdfLinked.Connect = strConnect
tdfLinked.SourceTableName = "SOURCING.TXT"
CurrentDb.TableDefs.Append tdfLinked
--------------------------------------------------------
I know that the code I have written is for linking a file to an Access database. I really would like to just import it.
Any help is much appreciated!!
Thanks,
Mike