Skip to Content
0
Former Member
Aug 03, 2005 at 01:46 PM

Populate Combo in matrix

11 Views

Hi,

I have a Matrix.

In Each row i want like to populate matrix with values based on the row.

My problem is once a combo gets populated in one row, the same value

gets populated for other rows also(inspite of changing values)

This is my code

Do Until rsWHID.EoF = True

i = i + 1

Dim sLength As String

sLength = rsWHID.Fields.Item("Length").Value

WHOH_Form.DataSources.UserDataSources.Item("usLot").ValueEx = ""

Dim sDate As String = Convert.ToString(rsWHID.Fields.Item("DueDate").Value)

WHOH_Form.DataSources.UserDataSources.Item("usDate").ValueEx = Convert.ToString(sDate).Replace(".", "")

WHOH_Matrix.AddRow()

sQuerySOWO = "select u_ORDER,U_SOWO from [@CDIplanorders] WHERE u_iTEMcODE='" & sItemNo & "' AND u_lENGTH='" & sLength & "'"

rsSOWO.DoQuery(sQuerySOWO)

WHOH_Form.DataSources.UserDataSources.Item("usCmboSOWO").ValueEx = ""

WHOH_Combo = WHOH_Matrix.Columns.Item("cmbSOWO").Cells.Item(i).Specific

For j = WHOH_Combo.ValidValues.Count - 1 To 0 Step -1

WHOH_Combo.ValidValues.Remove(j, SAPbouiCOM.BoSearchKey.psk_Index)

Next j

If Not rsSOWO.EoF() Then

Do Until rsSOWO.EoF = True

Dim strOrderNO, strWOorSO As String

strOrderNO = rsSOWO.Fields.Item("u_ORDER").Value

strWOorSO = rsSOWO.Fields.Item("u_SOWO").Value

WHOH_Combo.ValidValues.Add(strOrderNO, strWOorSO)

rsSOWO.MoveNext()

Loop

End If

rsWHID.MoveNext()

Loop

Pls help.