Hi Anoop,
Thank you very much for pointing out my error. That is just awesome. I have modified the sample coding to suit my IT System Analyst specifications and User Requirements.
Yaaa...hooooo.......the coding is working now and I would like to post the working VB6 coding here here to share it with other Newbies who may experience similar problems.
HERE ARE THE CODING:
With Me.MSFlexGrid1
.Clear
.Rows = 2
.Cols = adoRst.Fields.Count
Dim i As Integer
' format FlexGrid Header and column width
For i = 0 To (adoRst.Fields.Count - 1)
.TextMatrix(0, i) = adoRst.Fields(i).Name
.ColWidth(i) = 1400
Next
'fill with MsFlexGrid cells with data using ADO Recordset
Do While Not adoRst.EOF
.TextMatrix(IRow, 0) = adoRst.Fields(0).Value
.TextMatrix(IRow, 1) = adoRst.Fields(1).Value
If Len(adoRst.Fields(2).Value) > 0 Then .TextMatrix(IRow, 2) = adoRst.Fields(2).Value
If Len(adoRst.Fields(3).Value) > 0 Then .TextMatrix(IRow, 3) = adoRst.Fields(3).Value
If Len(adoRst.Fields(4).Value) > 0 Then .TextMatrix(IRow, 4) = adoRst.Fields(4).Value
.Rows = .Rows + 1
IRow = IRow + 1
adoRst.MoveNext
Loop
End With
Thank you very much Anoop. Appreciate your help very much. So glad that I met you at this awesome FORUm