Hi everybody

I have a small prototype view with a dbCJGrid with data from a journal. At the bottom should be a SpinForm to change the year. The form has a OnChange procedure which fills a property of the DD, calls the Rebuild_Constraints and sends the MoveToFirstRow to the grid. this works fine once the view is visible BUT...

...when the SpinForm is filled by Procedure Activating the programm stops with an GET_ORDERING error.

After some debugging it seems to me that the origin of this error is that the TableSource does not find a Server (hoServer = 0) at startup.

here's the code - any ideas?

Code:
Use Windows.pkg
Use DFClient.pkg
Use cJournalDataDictionary.dd
Use cDbCJGrid.pkg
Use dfSpnFrm.pkg

Deferred_View Activate_oJournal for ;
Object oJournal is a dbView
    Object oJournal_DD is a cJournalDataDictionary
        Property Integer piYear
        
        Procedure OnConstrain
            Date dFrom dTo

            // not too elegant but it works - german date format
            Move ("01.01." + (String(piYear(Self)))) to dFrom
            Move ("31.12." + (String(piYear(Self)))) to dTo
            
            Constrain Journal.Bookingdate ge dFrom
            Constrain Journal.Bookingdate le dTo
            
        End_Procedure
    End_Object

    Set Main_DD to oJournal_DD
    Set Server to oJournal_DD

    Set Border_Style to Border_Thick
    Set Size to 293 421
    Set Location to 2 2

    Object oDbCJGrid1 is a cDbCJGrid
        Set Size to 236 369
        Set Location to 18 25

        Object oJournal_Datum is a cDbCJGridColumn
            Entry_Item Journal.Bookingdate
            Set piWidth to 90
            Set psCaption to "Date"
        End_Object

        Object oJournal_Text is a cDbCJGridColumn
            Entry_Item Journal.Text
            Set piWidth to 270
            Set psCaption to "Text"
        End_Object

        Object oJournal_Betrag is a cDbCJGridColumn
            Entry_Item Journal.Amount
            Set piWidth to 72
            Set psCaption to "Amount"
        End_Object
    End_Object

    Object oSpinForm1 is a SpinForm
        Set Size to 13 100
        Set Location to 266 42
        Set Maximum_Position to 2099
        Set Minimum_Position to 1980
    
        Procedure OnChange
            Integer iYear
            Get Value to iYear
            Set piYear of oJournal_DD to iYear
            Send Rebuild_Constraints of oJournal_DD
            
            // This will end in an error since no server is found at procedure ordering
            // Send MovetoFirstRow of oDbCJGrid1

            // This will prevent an error but at startup, the grid stays empty
            // When the users changes the value afterwards everything works fine            
            Handle hoDataSource hoServer
            Get phoDataSource of oDbCJGrid1 to hoDataSource
            Get Server of hoDataSource to hoServer
            If (hoServer <> 0) Begin
                Send MovetoFirstRow of oDbCJGrid1
            End

        End_Procedure
    
    End_Object

    Procedure Activating
        Forward Send Activating
        
        Set Value of oSpinForm1 to 2010 // this would usualy come from a system file
        
    End_Procedure
    

Cd_End_Object