Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BoundTo and combobox
Message
From
26/06/2003 10:41:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00803585
Message ID:
00804192
Views:
47
David,

I tried doing it like this, but the combobox doesn't display anything, even when I click on it. The array does have data in it. (I stepped through the code.) I tried creating an array property on the form and binding the control to that, but the same thing happens. This is crazy! What am I missing?
Local lcSQL

This.AddProperty("aKeyaccmgr(1)")
*-----------------------------------------------------------------
*-- JMW - May 27, 2003 
*-- Get KeyAcctMgr data by region
*-----------------------------------------------------------------
Select mgrname, id ;
	from keyaccmgr ;
	where geo_area = m.us_geo_area ;
	into array This.akeyaccmgr ;
	order by mgrname
	
*-----------------------------------------------------------------
*-- JMW - May 27, 2003 
*-- Set the combobox attributes
*-----------------------------------------------------------------
With this
	.rowsourcetype = 5 && Array
	.rowsource = This.akeyaccmgr
	.BoundColumn = 2
	.BoundTo = .T.
	.ControlSource = "Sponsor.Keyaccmgrid"
	.ColumnCount = 2
	.ColumnLines = .f.
	.ColumnWidths = "200,0"
	.Requery()
Endwith


Return
>James,
>
>Does m.us_geo_area indeed have a value at the time the cbo instantiates?
>
>For my cbo classes I use an array property of the cbo itself and do the SELECT into the array.
>
>>
>
>>Local lcSQL
>>
>>*-----------------------------------------------------------------
>>*-- JMW - May 27, 2003
>>*-- Get KeyAcctMgr data by region
>>*-----------------------------------------------------------------
>>lcSQL = ;
>>	"Select mgrname, id " + ;
>>	"from keyaccmgr " + ;
>>	"where geo_area = m.us_geo_area " +;
>>	"into cursor c_keyaccmgr " + ;
>>	"order by mgrname"
>>
>>*-----------------------------------------------------------------
>>*-- JMW - May 27, 2003
>>*-- Set the combobox attributes
>>*-----------------------------------------------------------------
>>With this
>>	.rowsourcetype = 3 && SQL Statement
>>	.rowsource = lcSQL
>>	.BoundColumn = 2
>>	.BoundTo = .T.
>>	.ControlSource = "Sponsor.Keyaccmgrid"
>>	.ColumnCount = 2
>>	.ColumnLines = .f.
>>	.ColumnWidths = "200,0"
>>	.Requery()
>>Endwith
>>
>>
>>Return
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform