Your code pretty much looks correct. The only thing that I see is that you don't initialize Thisform.pnCombo until after the combo has been instantiated. Since Thisform.pnCombo is a logical when the combo initializes, that may be a problem. Try moving the code that initializes Thisform.pnCombo to the form's Load method.
>Hi,
>
>I think this question has been asked a 1000 times but i'm still stuck on it.
>On my form there is a combo with 4 items, the PK is different from the listindex so I used BoundTo=3, every time I select another value the display of the combo blanks. If I remove the controlsource it works ok but then I can't use the combo to put in a initial value. If I set BoundTo to .f. it works ok but then I get the listindex in the controlsource and not the PK. Below I attached some of the code I used.
>
>&& Form Load
>&& create a cursor with some test data
>create cursor test (v1 L,v2 c(10),v3 n(1))
>insert into test (v1,v2,v3) values (.t.,"test1",1)
>insert into test (v1,v2,v3) values (.t.,"test2",2)
>insert into test (v1,v2,v3) values (.t.,"test3",4)
>insert into test (v1,v2,v3) values (.t.,"test4",5)
>
>&& Form init()
>&& set an initial value
>thisform.pnCombo=4
>thisform.refresh()
>
>
>&&Combo
>Boundcolumn=3
>BoundTo=.T.
>Controlsource=thisform.pnCombo
>RowSource=test->v2,v1,v3
>RowSourceType=2 alias
>
>
>Any help will be very welcome,
>
>Guillaume