RowSource behavior

Microsoft Visual FoxPro - Programmer Exchange

Microsoft
What am I not seeing here.
table - xtest

fields
name, id

values
red,1
blue,2
yellow,3

combo1.RowSourceType = 3    && sql statement


optiongroup1

InteractiveChange()
IF This.Value = 1
    ThisForm.combo1.RowSource = 'SELECT name FROM xtest into array aQuery'
ELSE
    ThisForm.combo1.RowSource = 'SELECT id FROM xtest into array aQuery'
ENDIF
ThisForm.combo1.Requery()
                                            
Stefan
I believe its just the "way it works" - RowSourceType 3 expects a
cursor or even a table (at least the online help says so).
IMO a good way to use an array is to have a combo.Init() like
    With This
        .AddProperty('aRowsource[1]')
        Select * From theTable Into Array (This.aRowsource)
        .RowSourceType = 5
        && etc.




 hth
-Stefan


 |\_/| ------ ProLib - programmers liberty -----------------
 (.. ) Our MVPs and MCPs make the Fox run....
  - /  See us at www.prolib.de or www.AFPages.de
 -----------------------------------------------------------