hi people,

I am trying to open a text file and put the data into an msflexgrid. there are 2 problems here. first is i can not get the info into the grid. second is when i do somehow it only goes in on the first row of the grid and does not tab between columns. below is my code, can anyone see what the problem is.

Private Sub cmdOpenFile_Click()

Dim WeekNo As String
Dim i, j As Integer
Dim filerec As Integer
Dim rec2 As String

WeekNo = cboWeek.Text
intNum = FreeFile
CreateIndex
Open "C:\Timesheets\" + WeekNo + ".txt" For Random As intNum Len = Len(WriteData)

On Error Resume Next
If numData > 0 Then
ReDim Index(numData)
CreateIndex
End If
Get #intNum, Index(Record).RecNum, WriteData

rec2 = Trim(Index(Record).Date)
If rec2 = Empty Then
Record = Record + 1
End If
For i = 0 To Grid1.Rows - 1
Get #intNum, Index(Record).RecNum, WriteData
Record = Record + 1
numData = LOF(1) / Len(WriteData)
Seek #intNum, Loc(1) - 1
For j = 0 To Grid1.Cols - 1
With WriteData
Grid1.TextMatrix(i, 0) = .dates
Grid1.TextMatrix(i, 1) = .client
Grid1.TextMatrix(i, 2) = .jobno
Grid1.TextMatrix(i, 3) = .desc
Grid1.TextMatrix(i, 4) = .types
Grid1.TextMatrix(i, 5) = .time
Grid1.TextMatrix(i, 6) = .adstfx
Grid1.TextMatrix(i, 7) = .notes
End With
Next j
Next i
Close intNum
End Sub

Sub CreateIndex()
Dim indexEntry As IndexType
Dim i, j
Dim temp As String

For i = 1 To numData
Get #intNum, i, WriteData
temp = WriteData.dates
Index(i).Date = temp
Index(i).RecNum = i
Next i

For i = 1 To numData - 1
For j = i + 1 To numData
If Index(i).Date > Index(j).Date Then
indexEntry = Index(i)
Index(i) = Index(j)
Index(j) = indexEntry
End If
Next j
Next i
End Sub

i have been working on this for 3 days now so if anyone has any suggestions it would be greatly appreciated.

thanks