cancel
Showing results for 
Search instead for 
Did you mean: 

Addin one extra coloum in the matrix when it in loop

Former Member
0 Kudos

dear all

can you tell me what wrong in following code. when it is going on loop aaded one extra coloum in the matrix with blank value..


If topvalue > 0 Then
                                                    oMatrix.Clear()

                                                    With oSubForm.DataSources.DBDataSources.Item("@TINSP3")
                                                        oMatrix = oSubForm.Items.Item("1000001").Specific
                                                        Dim x As Integer
                                                        For x = 1 To topvalue
                                                            oMatrix.AddRow()
                                                            'Dim str As String = oEditText.Value
                                                            .InsertRecord(.Size)
                                                            '.SetValue("U_SAMPLENO", .Size - 1, x)

                                                            .SetValue("U_SAMPLENO", .Size - 1, x)

                                                        Next
                                                        oMatrix.LoadFromDataSource()


                                                    End With
                                                End If

Accepted Solutions (1)

Accepted Solutions (1)

former_member689126
Active Contributor
0 Kudos

Hi

Try this code

If topvalue > 0 Then

                oMatrix = oSubForm.Items.Item("1000001").Specific

                With oSubForm.DataSources.DBDataSources.Item("@TINSP3")

                    .Clear()
                    oMatrix.FlushToDataSource()

                    Dim x As Integer
                    For x = 1 To topvalue

                        .InsertRecord(.Size)
                        .SetValue("U_SAMPLENO", .Size - 1, x)

                    Next
                    oMatrix.LoadFromDataSource()

                End With
            End If

Regards

Arun

Answers (0)