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


I want to bind my ComboBox from query. How can I do that? Please help.

When the form is load, the ComboBox will fill from my database. Like BPName.


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 09, 2011 at 04:45 AM


    Try this

    Dim rsResult As SAPbobsCOM.Recordset = Nothing
                Dim sValue, sDescription As String
                rsResult = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
                While _comboBox.ValidValues.Count > 0
                    _comboBox.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
                End While
                rsResult.DoQuery("Select Code,Name from OUBR")
                While Not rsResult.EoF
                    sValue = rsResult.Fields.Item(0).Value.ToString()
                    sDescription = rsResult.Fields.Item(1).Value.ToString()
                    _comboBox.ValidValues.Add(sValue, sDescription)
                End While



    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.