I have used the import class module from
http://www.mvps.org/access/modules/mdl0057.htm. This reads my text file
into a string called myString. I am trying to append this string into
table tblTEMPVendors. The string is tab delimited. I am trying to use
the code below to do this but I need some help - How do I loop through
the string if this was a recordset I know i would use do while not
rs.eof but I can't get the syntax for a string variable.
Can anyone help?
Private Sub cmdImportVendors_Click()
Dim rsVendors As New ADODB.Recordset
Dim strAppendSQL As String
Dim strArray() As String
'Call function to return file to import
GetFName
'Call read file procedure
ReadAFile (strFName)
rsVendors.Open "tblTEMPVendors", CurrentProject.Connection,
adOpenDynamic
'Do While '???
strArray = Split(myString, vbTab)
If Not strArray(1) = "Vendor" Then 'exclude column heading
rsVendors.AddNew
rsVendors.Fields(0).Value = strArray(1)
End If
'Loop
rsVendors.Close
End Sub