I made the following function, the endlinetag is the tag used to indeicate the end of the line (vbcrlf most of the time) fieldsep is the carakter(s) wich seperate the fields pad is the location and name of the textfile to be inported (like "c:\inp.txt"

therecordset is the recordset where the information of the textfile needs to go.
Function trtext(ByVal endlinetag As String, ByVal fieldsep As String, ByVal pad As String, therecordset As Recordset)
' be sure that the lines in the textfile (rows in the recordset
' are no longer than 10000 carakters else you have to make the
' harm var longer
Dim harm As String * 10000
Dim fieldscountr As Integer
Dim beginline As Integer
Dim endline As Integer
Dim begfield As Integer
Dim endfield As Integer
Dim fieldseplength As Integer
Dim endlinetaglength As Integer
Dim line As String
Dim fieldje As String
endlinetaglength = Len(endlinetag)
fieldseplength = Len(fieldsep)
beginline = 1
endline = 3
Open pad For Binary Access Read Lock Read As #1
Do While endline > 0
Get #1, beginline, harm
endline = InStr(1, harm, endlinetag, vbTextCompare)
beginline = beginline + endline + (endlinetaglength - 1)
If endline > 1 Then
begfield = 1
endfield = 1
line = Mid(harm, 1, endline - 1) & fieldsep
' We got the row now make a new record in the recordset
therecordset.AddNew
fieldscountr = 1
Do While endfield > 0
endfield = InStr(begfield, line, fieldsep, vbTextCompare)
If endfield > 1 Then
fieldje = Mid(line, begfield, endfield - begfield)
' fieldje is filled with the field
' the first field is skipped because in the recordset
' this is probebly an outonumber
' the amount of fields in the textfile and recordset
' must be:
' fields in recordset - 1 = fields in the textfile
therecordset.Fields(fieldscountr) = fieldje
Else
' if the field in the textfile is empty nothing is
' filled in in the recordset, this could couse an error
' you could try to fill the field with nothing like:
' therecordset.fields(fieldscountr) = ""
End If
begfield = begfield + Len(fieldje) + fieldseplength
fieldscountr = fieldscountr + 1
Loop
therecordset.Update
End If
Loop
Close #1
MsgBox ("einde functie "

End Function