If you run with SET DELETED ON and try
select pTnt_Name from RegTrans group by 1 INTO CURSOR csr_names NOFILTER ORDER BY ptnt_name
would the speed be the same as before?
>Hi Gang!
>
>I have a form which has a combobox that I want to populate from a field from a table called REGTRANS. The field is PTNT_NAME (C-30).
>
>In the LOAD of the form, I have this code....
>
>
>*!* *Create data for the patient Name combobox
>SELECT DISTINCT ptnt_name FROM regtrans WHERE DELETED() = .F. INTO CURSOR csr_names ORDER BY ptnt_name
>
>
>I have an index in REGTRANS called DELETED which is indexed on DELETED().
>The form has SET DELETED ON.
>
>For the combobox, here are the DATA properties...
>
>CONTROLSOURCE csr_names
>ROWSOURCE csr_names.ptnt_name
>ROWSOURCETYPE 2 - ALIAS
>VALUE ""
>
>
>When I bring up the form, the SELECT statement takes about 35 seconds to populate the combobox....
>
>REGTRANS has 2,693,163 records and the SELECT statement pulls out 244,799 recods (for the combobox). When form comes up, the combobox works fine (very responsive and I can do the Incremental Search.
>
>It just takes TOO DANG LONG to come up!!!
>
>Does anyone see anything wrong in how I set this up (Rushmore????).
>
>Thanks!
If it's not broken, fix it until it is.
My Blog