Here's code I have to import one line of text into an access table:
The problem I have is that sometimes the first line is Source_Data which I don't want read into the table.
The file looks something like this:
Source "Customers.xls"
Source_Data "100240"
Source "Products.xls"
Source_Data "1230"
The text file that it reads is space separated rather than fixed width. How can I change my code to read and import space separated values rather than a fixed amount of characters?
Thanks in advance.
TN
Code:
strBuffer = f.readline
strValue = Mid(strBuffer, 1, 6)
Select Case strValue
Case Is = "Source"
rs.AddNew
rs!Field1 = Mid(strBuffer, 10, 30)
Datasource = rs!Field1
rs.Update
End Select
The problem I have is that sometimes the first line is Source_Data which I don't want read into the table.
The file looks something like this:
Source "Customers.xls"
Source_Data "100240"
Source "Products.xls"
Source_Data "1230"
The text file that it reads is space separated rather than fixed width. How can I change my code to read and import space separated values rather than a fixed amount of characters?
Thanks in advance.
TN