Skip to Content
0
Former Member
Jun 19, 2012 at 09:56 AM

combo box value value ....exists?

76 Views

Hi.. See the image emp..

This is my Small addon just like a emp master data....

I have inserted the fileds...

country is allso one of the filed....like in emp screen.

My requirement is if i click country all the country names will come...

but only some values are comming...

in emp screen upto z names are comming..

See emp2 image only upto 'c' values are comming..

if i once run the program """"value value is exisiting" is comming..

If i comment the code the error is not comming..

remaining combo values like position,depatment, branch every value is comming except country.

(small info: [the country names are containing some duplicates one or two are repeating is it giving any error)

may i know what is the problem..

how can i solve this one

my code is.... exactly at country is

Dim ocombo6 As SAPbouiCOM.ComboBox

oform = sbo_app.Forms.Item("TT")

ocombo6 = oform.Items.Item("129").Specific

Dim or7 As SAPbobsCOM.Recordset

or7 = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

or7.DoQuery(" select distinct t0.name from ocry t0")

For i As Integer = 1 To ocombo.ValidValues.Count - 1

ocombo6.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)

Next

While or7.EoF = False

ocombo6.ValidValues.Add(or7.Fields.Item(0).Value, or7.Fields.Item(0).Value)

or7.MoveNext()

End While

Attachments

emp3.JPG (114.8 kB)
emp2.JPG (143.2 kB)
emp.JPG (118.9 kB)