Hi experts,
I want to fill my matrix with a query. But when I click my search button nothing appears in my matrix. I don't know if it's a query which is wrong or my code. The query should run when I selects the code of a ship and I click on the "Search" button.
This is my code:
If (pVal.ItemUID = "RechNav") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim req As SAPbobsCOM.Recordset
Dim i As Integer = 1
req = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
req.DoQuery("SELECT U_CdNav,U_NLloyd,U_DclrNav,U_PavDN,U_Cng,U_AgCng FROM [@DESC] WHERE U_CdNav='" & TxtCodN.Value & "'")
Dim matrix As SAPbouiCOM.Matrix
matrix = oForm.Items.Item("Liste_escale").Specific
While req.EoF = False
matrix.Columns.Item("V_0").Cells.Item(i).Specific.Value = req.Fileds.Item("U_CdNav").Value
matrix.Columns.Item("V_13").Cells.Item(i).Specific.Value = req.Fileds.Item("U_NLloyd").Value
matrix.Columns.Item("V_12").Cells.Item(i).Specific.Value = req.Fileds.Item("U_DclrNav").Value
matrix.Columns.Item("V_11").Cells.Item(i).Specific.Value = req.Fileds.Item("U_PavDN").Value
matrix.Columns.Item("V_10").Cells.Item(i).Specific.Value = req.Fileds.Item("U_Cng").Value
matrix.Columns.Item("V_9").Cells.Item(i).Specific.Value = req.Fileds.Item("U_AgCng").Value
i = i + 1
req.MoveNext()
End While
End If
Regards.
Olivier.
Edited by: Olivier KPOLO on May 18, 2010 2:55 PM
Edited by: Olivier KPOLO on May 18, 2010 2:57 PM
Edited by: Olivier KPOLO on May 18, 2010 2:58 PM