Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When is a ComboBox's RowSource cursor create?
Message
From
13/02/2008 17:25:49
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01292415
Message ID:
01292425
Views:
21
Should it matter that it is in a container and part of a class?

>>I have SQL as the RowSource of a ComboBox. When is that SQL run and the cursor created? It is not available in the INIT of the form and I was hoping that it would be. The ComboBox is instantiated prior to the form, right?
>
>Jay,
>
>It is available in the init of the form
>
>
>loForm			= Createobject('myForm')
>loForm.Show(1)
>
>define class myForm as Form
>	add object myList as myCombobox
>
>	procedure Load()
>		local i
>		create cursor myData (PK I Autoinc, DataValue C(10))
>		for i = 1 to 100
>			insert into myData (DataValue) values (Sys(2015))
>		next i
>	endproc
>
>	function init() as Boolean
>		select myDataCursor
>		browse normal nowait
>		return .t.
>	endfunc
>enddefine
>
>define class myCombobox as ComboBox
>	RowSource		= 'select top 10 DataValue from myData order by 1 into cursor myDataCursor'
>	RowSourceType		= 3
>enddefine
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform