I have a header/detail file pair on a dbView. The header record is found and some of its fields are shown on the first page on a dbTabDialog. On another page there is a CJGrid (not dataaware) which shall be filled with data from the detail file.

When I turn through the header file, detail date on the tab page shall be updated which is done in OnPostFind in the header fiele dd. However, the detail tab page must be active. If not I get error 4399, Attempt to use object before it’s been initiated. But then, the detail grid is not updated before it has been shown on the screen. I tried to solve that by loading grid data in OnEnterArea and it looks nice, but then comes another problem. I have checkbox column in the grid to mark which rows that later shall be processed, and when clicking the button for doing this, OnEnterArea is executed again overwriting my marks.

How can that be solved? How can that object be intiated?


    Object oSveVaxt_DD is a cSvevaxtANR_DataDictionary
        Set DDO_Server to oSveInfkd_DD
        Procedure OnPostFind Integer eMessage Boolean bFound
            Boolean bActive
            Forward Send OnPostFind eMessage bFound
            Get Active_State of (oCJGrid1(oDbTabPage6(oDbTabDialog1(Self)))) to bActive
            If bActive Begin
                Send LoadData of (oCJGrid1(oDbTabPage6(oDbTabDialog1(Self))))
            Procedure OnEnterArea Handle hoFrom
                String sVaxt
                Forward Send OnEnterArea hoFrom
                 Send LoadData of (oCJGrid1(oDbTabPage6(oDbTabDialog1(Self))))