>Hi All,
>
>I have a container of objects that I have created. I did this so I could instantiate container in several different places. I also wanted instantiate the container on a page of a pageframe at run time. Everything was working fine until I decided to add a combo box to the container as lookup for one column in a table. I have code in the combo class so it will populate itself with the proper data at run time. Here is the issue. Only on the page the init code will not run. I put the following in the init:
>
>Set step on
>Dodefault()
>
>This code does not seem to run because the error I get is it can’t find the cursor that I have setup in the rowsource. If I drop the container on a form all works as expected. I also put the same code above in the container’s init and it did not seem to fire as well.
>
>Hope someone has some ideas?
>
>More info. I cleared the rowsource and added the rowsource on the last line of the init it is now working????? Not sure why this made a difference.
James,
Probably it's related with event firing sequence. When there are multiple objects on a form (who has < bg >) first the innermost object's init fires and last the form's. That's roughly like :
form.pgf.pg.cnt.cmb.init
form.pgf.pg.init
form.pgf.init
form.init
I suspect rowsource is not loaded in form.load or from dataenvironment which both occur before any init.
PS: If rowsourcetype was SQL it'd open its base table(s) automatically. If applicable I suggest to use SQL rowsource instead of fields or alias.
Cetin