PS: This code having all lines starting with THISFORM, needs to be in any form or form control method to work. You can also make use of Addobject from "outside" of the form, but you need a variable holding a form reference as it's value, then you can use that variable name instead of THISFORM. eg
Do form ...NAME loFORM LINKED
loForm.AddObject(...)
...
In this sepcific case, when you do this directly after the DO FORM or you would do it in the form init, you better do it in the form itself.
Also take note that in case you need a control or label sometimes and not other times, you can add it to the form and use it's visible property to hode or show it, you don't need to add it at runtime. And last not least it's preferable to use OOP, form classes you can inherit from. You can add a label or any amount of spcific controls to a child form class. You can even start with an empty base form, there are many things you can do in form methods you can recycle for any further form. Don't neglect the possibility to make use of inheritance and write once, use many times, just because you can't DO FORM a form class.
You can always have an SCX based on any form class and use it as usual. You only develop and extend your form classes and you use your SCXes. That's also a viable approach.
Bye, Olaf.