Dim s As String, blOK As Boolean
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Contacts")
Open "C:\text.txt" For Input As #1
rs.AddNew
Do Until EOF(1)
Line Input #1, s
If blOK = False Then
Do
Line Input #1, s
blOK = InStr(s, "FirstName") > 0
Loop Until InStr(s, "FirstName") > 0
End If
If blOK Then
rs(Trim(Split(s, "=")(0))) = Trim(Split(s, "=")(1))
End If
Loop
rs.Update
Close #1
rs.Close
|