cancel
Showing results for 
Search instead for 
Did you mean: 

how to get value to matrix coloum

Former Member
0 Kudos

hi every one

i have user form where i have a matrix with some columns...

in first column of matrix i have opened a sub form with some details in OPCH table( DocNum) when i double click on sub form i have to get the selected value into mu matrix coloumn...

i have written this code...

If Gval = "V_0" Then
                                        oMatrix.Columns.Item("V_0").Cells.Item(1).Specific.value = ogrid.DataTable.GetValue(1, pVal.Row)
                                        ' oMatrix.Columns.Item("V_0").Cells.Item(1).Specific.value = ogrid.DataTable.GetValue(1, pVal.Row)
                                        'oMatrix.Columns.Item("V_1").Cells.Item(1).Specific.value = ogrid.DataTable.GetValue(24, pVal.Row)
                                        'oMatrix.Columns.Item("V_2").Cells.Item(1).Specific.value = ogrid.DataTable.GetValue(12, pVal.Row)
                                        'oMatrix.Columns.Item("V_3").Cells.Item(1).Specific.value = ogrid.DataTable.GetValue(10, pVal.Row)
                                    End If

but this is throwing error as Invalid row index.....

but when i try to get value in a msgbox...iam getting value perfectly....

plz provide me the solution...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shenaz,

Matrix row index is a 1 based collection oposed to a DataTable/DBDataSource row index, which is 0 based.

So, when reading/writing to a Matrix Row use pVal.Row. When reading/writing to a DataTable/DBDataSource use pVal.Row-1.

Regards,

Vítor Vieira