Microsoft KB Archive/147208

= PRB: Incremental Search Always on 1st Col of Multi-Column List =

Article ID: 147208

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q147208



SYMPTOMS
When the IncrementalSearch property of Visual FoxPro's list box or combo box is set to True, the list box or combo box is capable of performing an incremental search of values within the object. However, when the list box or combo box has multiple columns and the RowSourceType property is set to either 2-Alias or 5-Array, the incremental search is applied to the first column in the list, regardless of the column to which the order is bound.



RESOLUTION
To apply incremental searching to a column other than the first, you need to reorder the field list in the RowSource property of the list box if the RowSourceType property is set to 2-Alias, or reorder the array if the RowSourceType property is set to 5-Array.

For more information on the IncrementalSearch property, Please see the following article in the Microsoft knowledge Base :

137125 How to Use IncrementalSearch Property of List and Combo Boxes



STATUS
This behavior is by design.



Steps to Reproduce Behavior
This example uses the Customer table located in the Vfp\Samples\Data directory with indexes created on the Company and Contact fields.


 * 1) Using the Form Designer, create a new form.
 * 2) Open the Data Environment, and add the Customer table.
 * 3) Right-click the Customer cursor in the Data Environment window, and select Properties.
 * 4) In the Properties window (Cursor1 should be the object), set the Order property to Contact.
 * 5) Add a list box to the form. Set the list box RowSourceType property to 2-Alias, and set its RowSource property to Company + Contact. Set its IncrementalSearch property to true (.T.), which is the default. Set its FontName Property to Courier.
 * 6) Save and run the Form. Note that the incremental searching in the list box is applicable to the first column, which is the Company Field. To perform an incremental search on the Contact field, which is the second column, you must reorder the fields to display the Contact field in the first column.

Additional query words: VFoxWin

Keywords: KB147208

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.