How to display multiple columns of the SQL-SELECT cursor in a combobox object in Visual FoxPro (134466)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro 9.0 Professional Edition

This article was previously published under Q134466

SUMMARY

This article describes how to populate a combobox object with multiple columns. This is done from a cursor that is created by using a SELECT-SQL statement.

MORE INFORMATION

For a DropDown ComboBox to display an initial value and multiple columns from a cursor created by an SELECT-SQL 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 GotFocus event
   This.Value = MyCursor.MyField
				

Modification Type:MajorLast Reviewed:3/11/2005
Keywords:KB134466