>I am trying to populate a combo box using the following code in COMBO INT() Method.
>
>
>SELECT Distinct Exchange FROM SEARCHREPORT WHERE !ISNULL(Exchange) GROUP BY EXCHANGE INTO CURSOR EXCHANGEWISEOUTSTANDING
>This.RowSourceType= 0
>WITH This
>.AddItem('All Exchanges')
>
>GO Top
>SCAN
>Browse
>.AddItem(Searchreport.exchange)
>ENDSCAN
>ENDWITH
>This.Requery()
>Thisform.Combo1.Refresh
>Thisform.combo1.ListItemId=1
>
>
> I could see from the browse window that each record in cursor EXCHANGEWISEOUTSTANDING is scanned properly (Around 15 items).
>
>However at the end I get Combo with only two items "All Exchanges" and "SRBZ1001".
>"SRBZ1001" is neither at top nor bottom. Whats Going wrong ? What should I do ?
Get the Browse out of the SCAN loop. It moves the record pointer.
Also, you don't need bother DISTINCT and GROUP BY in the query. Either one will do and DISTINCT makes it more obvious what you're doing.
Finally, get rid of the call to Requery at the end of the loop. Unneeded and might cause trouble.
Tamar