Hi
I am trying to display a table from Access in a Flexgrid.
For some reason, the flexgrid only displays the first record from the table and doesnot show any other record!
Can someone please help!!
Here's the code:
Set cmd.ActiveConnection = conn
cmd.CommandText = "SELECT WFJob,JobTitle,FLSA FROM Delte where WFTJob= '" & str & "'"
cmd.CommandType = adCmdText
Set rs = cmd.Execute
frmReport.MSGrid1.Cols = rs.Fields.Count + 1
HSE = 1
frmReport.MSGrid1.Row = 0
frmReport.MSGrid1.Col = 0
For j = 0 To rs.Fields.Count - 1
frmReport.MSGrid1.Col = j + 1
frmReport.MSGrid1.Text = rs.Fields(j).Name
Next
If rs.EOF = False Then
'Assigning Column names to flexgrid 1st row
Do While Not rs.EOF
frmReport.MSGrid1.Row = HSE
frmReport.MSGrid1.Col = 0
frmReport.MSGrid1.Text = HSE
For j = 0 To rs.Fields.Count - 1
frmReport.MSGrid1.Col = j + 1
frmReport.MSGrid1.Text = IIf(IsNull(rs(j)), "", rs(j))
Next j
rs.MoveNext
DoEvents
HSE = HSE + 1
Loop
End If
Next i
frmReport.Show
Thanks in advance for your help!!