Jerry,
Heres an example of what you need to do
Dim FileLine As String
Dim RecType As String
Dim LineNo As Long
Open "C:\import.txt" for input As #1
LineNo = 0
Do While Not EOF(1)
Line Input #1, FileLine
LineNo = LineNo + 1
RecType = Mid(FileLine, 1, 5)
Select Case RecType 'choose import based on first 5
Case "XXXXX"
Field1 = Mid(FileLine, 6, 20)
Field2 = Mid(FileLine, 27, 10)
Case "YYYYY"
Field1 = Mid(FileLine, 6, 11)
Field2 = Mid(FileLine, 18, 15)
Case Else
MsgBox "Unrecognized record type in FileLine " & LineNo
End Select
Loop
Close #1
Mid returns a portion of a string, it takes 3 arguments. The original string, the start position within that string, and the length of the substring to return. The first call i am making to mid returns the first 5 characters (your record identifier). I am putting that identifier into the RecType variable and using that to decide which type of import to do. I showed the select case statement for illustration. You need to change it so there is one 'Case' statement for each of the 5 different types of records. For example where i have 'Case "XXXXX"' You need to put the 5 characters that make up your first record identifier. Then add a Case for each type of record. Inside each case use Mid to extract the values for each field, then insert them into the correct table. Good luck
Ruairi [sig]<p>Ruairi<br><a href=mailto:ruairi@logsoftware.com>ruairi@logsoftware.com</a><br>[/sig]