Skip to Content
author's profile photo Former Member
Former Member

multi comobox values

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 11:48 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.