on 06-17-2008 10:30 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.