Visual FoxPro General
I think the simplest way would be to set listbox RowSource in run-time rather than in design time.
BTW, I rarely use type SQL for RowSource and prefer to use Alias instead.
E.g. in the Init method of the form you can do
select * from myTable into cursor curMyList where ... nofilter
with thisform.ListBox1
.RowSourceType = 2 && Alias - check this
.RowSource = 'curMyList'
.requery()
endwith
BTW, to answer on your question why - form's controls Init fire before Form's Init (and always container's Init fire after its inner objects Init), so the property has to be available in Load or if this is impossible, objects properties have to be set in run-time.
In certain cases I even add grid on the fly if grid's cursor is only going to be available in the Init.
Prefer SQL rowsourcetype (3) instead of alias.
Init codes are ran in the order "innermost object first, outermost object last". Thus form.init is the last in the sequence. However solution is very simple. Do not set listbox's rowsourcetype and rowsource neither in PEM sheet nor in its init (leave at their default).
In form init or whereever you have the needed parameters are ready, set them. ie: In form init:
with this.lstSomeListbox
.RowSourceType = 3
.RowSource = "select * from myTable where myField = thisform.anum into cursor crsListSource"
endwith
Whenever anum changes you just requery listbox ( thisform.lstSomeListBox.requery() ). It's simple and slick and better than using alias.