In VFP6, a DataEnvironment doesn't get inherited. The DataEnvironment gets lost in the derived class.
If you need to open tables, set relations, filters, or activate an index, place commands in the Form.Load() event.
Relevant commands: USE; SET ORDER; SET FILTER; SET RELATION; SELECT
>FoxPro v6.0
>
>I have created a class called BASEFORM which is a sub-class of a VFP form. I have a few custom events for this form. One event that fires before the form closes has the following statement: oDataObject = THISFORM.DataEnvironment
>
>I have create another class called ENTRYFORM based off of my BASEFORM sub-class with more custom events and code.
>
>In a program I have a DEFINE CLASS MyForm AS ENTRYFORM. I use a CREATEOBJECT command to create a new instance of the class. Everything appears to work fine except when I close my form I receive an error 'Property DataEnvironment not found'. It's running the BASEFORM code but why would that code be causing an error? Is it because FoxPro thinks that the ENTRYFORM class is the parent class when it should be thinking that the BASEFORM is the parent class? Is there a way I can sub-class the ENTRYFORM class and have FoxPro use BASEFORM as my parent class instead on ENTRYFORM? Please advise.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)