Hi all.
I have a problem in retrieve data from database column and display the data in msflexgrid.
The attached code below can only display the first row data in recordset.
Can anyone here help me to fix this problem?
Thanks in advance.
VB Code:
Private Sub FG_ShowRecordset(myFG As MSFlexGrid, myRST As ADODB.Recordset) Dim iField As Integer, iNofFields As Integer Dim lRow As Long Screen.MousePointer = vbHourglass myFG.Redraw = False myFG.AllowUserResizing = flexResizeColumns myFG.ScrollTrack = True 'column header myFG.TextMatrix(0, 0) = "DocNo" myFG.TextMatrix(0, 1) = "ItemNo" myFG.TextMatrix(0, 2) = "Item" myFG.TextMatrix(0, 3) = "Occurances" With myRST 'loop for displaying the document id in DocNo column 'fields(0) = Id For x = 1 To myFG.Rows - 1 myFG.TextMatrix(x, 0) = .Fields(0).Value .MoveNext x = x + 1 Next End With myFG.Redraw = True Screen.MousePointer = vbNormal End Sub




Reply With Quote