cancel
Showing results for 
Search instead for 
Did you mean: 

multi comobox values

Former Member
0 Kudos

How to load and remove combo box values ? For Example : When i select Tamilnadu in one combo box then display the Districts in other combo box values.. How can i do that?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi gopi,

This is the coding for your question:-

If pVal.ItemUID = "State_Code" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT Then

oCombo = oForm.Items.Item("State_Code").Specific

FillDistricts_Combo(oCombo.Selected.Value)

End if

Private Sub FillDistricts_Combo(ByVal State_Code As String)

Dim RS As SAPbobsCOM.Recordset

RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RS.DoQuery("Select Districts from @State_Code where CODE='" & State_Code & "'")

While Not RS.EoF

oCombo_dist.ValidValues.Add(RS.Fields.Item("Districts").Value)

RS.MoveNext()

End While

Answers (1)

Answers (1)

Former Member
0 Kudos

It was solved here manytimes - try to search forum history.

In step:

1. Fill first combo with values

2. catch the event for selection value in first combo

3. based on selected value:

4. remove all records from seccond combo

5. fill the seccond combo with proper values again