Not using the wizard!
That is just for a single "table" of data.
You will have to use code to open the file and read one row at time.
Then based on that row you add the data to the correct recordset.
You may need 2 or 3 recordsets depending on what you want to do.
Here is the general idea:
Public Sub ImportFile(strPath As String)
Dim db As Database, rs As Recordset
Dim sLine As String, sTrimmed As String
Set db = CurrentDb
Set rs = db.OpenRecordset("TableName", dbOpenTable)
Open strPath For Input As #1
'Read a single line from an open sequential file and assign it to a String
variable.
Line Input #1, sLine
'Trim the leading blanks
sTrimmed = LTrim(sLine)
Do While Not EOF(1)
'read the next line of the file
Line Input #1, sLine
sTrimmed = LTrim(sLine)
'manipulate the string if necessary, then add it to the rs table.
If rs.BOF = True Then
rs.AddNew
Else
rs.Edit
End If
rs.Update
Loop
End Sub
--
Joe Fallon
Access MVP
Juster1954 said:
I have a text file that contains three types of fixed length records, each
type containing diffrent field information and sizes. The first field has a
type indicator (i.e. FH=File Header, FC=Trans Type & FD=Trans Detail). I
just want to import the records where the first 2 characters of the record
are equal to FH. Is there any easy way to select records from a text file
on importation??? Any help would be much appreciated.