>>I have a VFP form which has a dropdown list populated from an array which takes the data from a table. There are about 1000 entries. When my form instantiates there is a long delay with just the form border showing and not the other controls on the form. I am trying to get a much snappier appearance but I cannot work out how to delay the form showing until the array has been populated.
>>
>>Can anyone advise?
>>TIA
>>Barry Sutton
Cetin,
Thanks for that. I will look at it in more detail once I am back in the office. Travelling at the moment and not had chance to look at it.
Will be in touch...
Barry.
>
>Barry,
>As you mentioned somewhere else FoxyClasses has 2 moverlists. One uses native listbox which is slow by nature (that sample has less than 1K recs) and the other uses grids (11K+ recs in sample - does extra handling in selecting requested recs which I even couldn't dare to do in listbox version).
>With listbox and combos things get worse if you use array or additem. Answer is hidden in your question IMHO. You take the array from a table. Instead make rowsource the SQL itself w/o taking into an intermediate array to populate :
>
>
>with this
> .RowSourceType = 3
> .RowSource = "select field1,...fieldn from myTable "+;
> "where SomeCriteria "+;
> "order by SomeOrder "+;
> "into cursor crsMyCursor"
> .Columncount = 2
>
> .BoundColumn = 2
> .BoundTo = .t.
> .ColumnWidths='100,50'
> .Controlsource = ''
>endwith
>
>Now you have a cursor type rowsource. When you need to query a value you don't need to know its column in combo nor it should be part of combo columns. ie: If your SQL was :
>
>"select * from employee ..." and columncount is set to 2,
>
>In order to get emp_id value you don't need to know its column pos in combo. Just get it with crsMyCombo.Emp_id. In the same manner thought you only show 2 columns in combo you can access all fields of employee :
>crsmyCombo.ReportsTo would give you reportsto value for selected combo row item.
>
>Apart from this great advantage this type of combo loading is instant.
>Cetin