Microsoft KB Archive/155750

= PRB: Combo Box Does Not Show Item After Selecting Item =

Article ID: 155750

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 Q155750



SYMPTOMS
When an item does not appear in a combo box after you select it, make sure the combo box's ControlSource property is pointing to a field in a table. If it is, check the RowSource and RowSourceType properties. The item selected in the combo box might have more characters than the field that the combo box is bound to.

For example, if the combo box has a RowSourceType property of value, and the RowSource property value is larger than the field of the table that it is bound to with the ControlSource property, then lengthen the table's field to the widest item in the RowSource property or shorten the value of the RowSource property to the length of the field.

If any selected item in the combo box is equal to or less than the number of characters in the table's field, it appears in the combo box.



CAUSE
The field that the ControlSource property is bound to has fewer characters than the item selected in the combo box.



STATUS
This behavior is by design.



MORE INFORMATION
Whenever there is an item in a combo box list that has more characters than the field of a table that the combo box is bound to, the item you choose is written to the field in the table, truncated, but the item does not show up in the combo box. Any item in the combo box list that has the same or less than the number of characters than the field of the table appears correctly in the combo box and is written to the field. This happens regardless of what you set the RowSourceType property to as long as the ControlSource property of the combo box is set to a field of a table.

Steps to Reproduce Behavior
 Create a form and add the Customer table from the \Vfp\Samples\Data subdirectory to the data environment.  Add a combo box to the form and set the following properties: ControlSource = Customer.Cust_id RowSourceType = Value RowSource = 12345678, 12345, 56789012  Run the form and choose the first item in the drop-down list of the combo box. Note that the item does not appear in the combo box after being chosen. Browse the Customer table and observe that the first six characters of the item in the combo box are stored in the Cust_id field. Close the table's Browse window and choose the second item in the combo box. Note that the item shows up in the combo box and also in the field of the table.

Additional query words: kbdse vfoxwin

Keywords: KB155750

-

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

© Microsoft Corporation. All rights reserved.