>I have a problem with DataEnvironment class.
>I have made aForm class with CDELoader member object on it with Init method which contains code for creating DataEnvironment class which I have created in separate .PRG program. I have put in DataEnvironment class OpenTables() method in Init method of that DE class.
>I have made a subclass of aForm class – cForm class. In cForm class I have added some textboxes with control sources which tables are defined in DE class.
>When I try to CREATEOBJECT(“cForm”) I get message “Error instantiating the object”. When I remove control sources from textboxes everything is OK.
>So I have get to this conclusion: instance of DE class is made after textboxes, and that is why control sources couldn’t pass. OpenTables() do open tables but, as it appears, too late.
>
>Why is this happening, and how can I solve this problem?
If you are in VFP8, set the Forms BindControls to False in the class, open the tables, then set the BindControls to True.
OR
Move the opentables to the Forms Load event.
Tracy