Darren:
Can you delay the instantiation of the Textbox on the small (popup) Form until after the INIT, since then you will know the Controlsource. So a plain Form will be created, then you can AddObject("TextBox") as follows:
oPopupForm.Init()
Parameters oControlSource
THIS.AddObject("MytextBox","TextBox")
MyTextBox.ControlSource = oControlsource
MytextBox.Visible=.T.
...or somthing along those lines, HTH,
-Irv.
>I am having a big problem trying to figure out the best way of passing variable references to sub forms for the control sources of text boxes etc. For example, I have a container class setup for a grid that includes add, edit and delete buttons. When the user clicks add, another small form class pops up on top of the grid with the related fields contained in it. We are using sql server with an ado connection, so the control source must be something like oobject.customer.customer_nme. But I can't use a public variable like oobject as the control source as multiple sub forms can be open at once and they would conflict with each other. So I have been trying to pass an object reference to the form but this goes to the Init method which fires after all of the text boxes do so it is too late. It would be nice to be able to pass it to the load event but I don't think that's possible? The control source could then be thisform.oobject.customer.name. Any suggestions?