Microsoft KB Archive/130544

= How to Place Values Containing Commas in a Combo Box =

Article ID: 130544

Article Last Modified on 2/11/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q130544



SUMMARY
Visual FoxPro doesn't allow values containing commas in the RowSource property when creating a list box based on static values because commas are used as separators. This article shows you how to handle values that do contain commas.



MORE INFORMATION
In Visual FoxPro, you can create a combo box or popup list box based on static values by following these steps:


 * 1) Add a Combo box to an existing form.
 * 2) Change the RowSourceType property to 1 - Value.
 * 3) Create a list of items seperated by commas in the RowSource property.

Visual FoxPro treats the RowSource as a text string. It searches for commas, using the items seperated by commas to create a list of items. Therefore, you cannot create values that contain commas.

If you have values that contain commas, base the Combo box on an array that contains the values by following these steps:


 * 1) Add an array called myarray to the form by selecting New Property from the Form menu and entering Myarray(1) in the dialog box.
 * 2) In the Load event of the form, redimension and populate the array with the values that have embedded commas.
 * 3) Change the RowSource property to the name of the array.
 * 4) Change the RowSourceType property to 5 - Array.

Additional query words: VFoxWin

Keywords: kbcode KB130544

-

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

© Microsoft Corporation. All rights reserved.