Rajani,
I would not define the container class with the textbox.ControlSource set to anything, leave it blank. Then when you drop the instance of the container on the form you can select the textbox and bind the textbox to the appropriate table.field from the property sheet.
O-O encapsulation though says you shouldn't deal with the internal objects of the container. You can define a property at the container level and set it, then the container class would have code that would deal with setting up the textbox.
>Hi David
>Thank u very much for ur explanation.
>may be u can give me ur expert advise here.
>
>I have class(say clsparent) with (container,textbox and a commandbtn) and i set controlsource property of the textbox to tabname.fldname.
>
>now i subclassed the abv class (say chldClass) .When i add this class (i.e chldClass)
>on a form thr code i get the error i specified in my initial post.
>i blanked out textbox control source property in subclass everything works fine but, as u know ,textbox does not show anything.
>i tried assigning controlsource in init() and load() but to no avail.
>can u give me some advise on this plz.
>many thanks