firoz.raj -3 Posting Pro in Training

i want if user select in any product_id it should list in another
Ms flex grid control .
kindly help me.
Private Sub Form_Load()
MSFlexGrid1.FixedRows = 1
MSFlexGrid1.FillStyle = flexFillRepeat
MSFlexGrid1.ColWidth(0) = 1000
MSFlexGrid1.ColWidth(1) = 3500
MSFlexGrid1.ColAlignment(0) = 4
MSFlexGrid1.ColAlignment(1) = 4
MSFlexGrid1.ColAlignment(2) = 4
MSFlexGrid1.Row = 1
MSFlexGrid1.Col = 0
MSFlexGrid1.RowSel = 5
MSFlexGrid1.Cols = 10 'Set dimensions of flexgrid and set selection behaviour
MSFlexGrid1.Rows = 10 'displaying grid
On Error Resume Next
MSFlexGrid1.CellFontBold = True
MSFlexGrid1.CellAlignment = 4
MSFlexGrid1.Font = "Arial"
MSFlexGrid1.TextMatrix(0, 0) = "Product_id"
MSFlexGrid1.TextMatrix(0, 1) = "Product_name"
MSFlexGrid1.TextMatrix(0, 2) = "Unit"
MSFlexGrid1.TextMatrix(0, 3) = "Quantity"
Dim R, C
Set rs = New Recordset
rs.CursorLocation = adUseClient
rs.Open "select distinct item_code,Productname,unit from partdetail ", con, adOpenDynamic, adLockOptimistic
If rs.RecordCount > 0 Then
Do Until rs.EOF
R = R + 1
For C = 0 To 4 Step 1
MSFlexGrid1.Rows = rs.RecordCount + 1
MSFlexGrid1.TextMatrix(R, C) = rs.Fields(C).Value
Next
rs.MoveNext
Loop
End If
End Sub

Kindly find attachment.doc also

I am waiting for your instant reponse sir

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.