DOCUMENT:Q134466 21-AUG-1999 [foxpro] TITLE :How to Display a SQL Cursor's Multiple Columns in a Combo Box PRODUCT :Microsoft FoxPro PROD/VER: OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 3.0 ------------------------------------------------------------------------------- SUMMARY ======= The documentation (Developer's Guide, Chapter 11, Using Controls, methods to populate various controls, Page 294) describes the functionality of the combo box but is not very explicit on how to populate the control. The documentation also identifies methods for populating list boxes and drop- down list boxes. You can use the methods used to populate the list boxes for the combo boxes as well. However, the documentation does not present a method to populate a combo box from a multiple-column SQL statement cursor. This article describes how to do it. MORE INFORMATION ================ For a DropDown ComboBox to display an initial value and multiple columns from a cursor created by an SQL SELECT statement, Microsoft recommends that you use the following property values and methods: Example ComboBox Properties: BoundColumn = 1 ColumnCount = 3 ColumnWidths = 0,100,100 RowSource = SELECT city+' '+region as MyField,city,region ; FROM Customer ; where !empty(region) ; into cursor MyCursor RowSourceType = 3 Example ComboBox Init Method: This.Value = MyCursor.MyField Additional query words: VFoxWin ====================================================================== Keywords : Technology : kbVFPsearch kbAudDeveloper kbVFP300 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1999.