Subject Re: what's the missing link to this grid behavior
From Dirk <non@non.com>
Date Wed, 13 Apr 2022 23:10:55 +0200
Newsgroups dbase.getting-started

Op 13/04/2022 om 21:22 schreef Ken Mayer:

Ken,
working on this way

i have modified the query, i made an inner join with stammdat

  and datalinked the grid, without datalinking the columms,

BUT

before sending i checked the inspector on the grid and under

query : vraagbak_bezoek the fields are mentioned of the vraagbak_firma
(if they are in the query)

solved

sometimes a push in the right direction grow wings

thank you very much

Dirk




this.VRAAGBAK_BEZOEK = new QUERY(this)
    with (this.VRAAGBAK_BEZOEK)
       left = 210.0
       top = 187.0
       width = 92.0
       height = 37.0
       database = form.databank_klanten
       sql = "select idnummer, name,visit, time1, time2 from visit
visit inner join stammdat on(stammdat.idnummer = visit.idnummer)  where
visit >=:Start and visit <= :Einde order by visit"
       requestLive = false
       params["Start"] = {  /  /    }
       params["Einde"] = {  /  /    }
       active = true
    endwith


   function knop_aanvang_onClick
    local dStart, dEinde, volgnr
     dStart= (form.keuzeveld_begin.value)
      dEinde=(form.keuzeveld_einde.value)
       this.parent.vraagbak_bezoek.params["Start"] = dstart
       this.parent.vraagbak_bezoek.params["Einde"] = dEinde
       this.parent.vraagbak_bezoek.requery()
        this.parent.rowset.first()
        this.parent.rooster_info.datalink =
this.parent.vraagbak_bezoek.rowset




> On 4/13/2022 11:52 AM, Dirk wrote:
>> Op 13/04/2022 om 18:25 schreef Ken Mayer:
>>> On 4/13/2022 8:59 AM, Dirk wrote:
>>>> Hello,
>>>>
>>>> when i Filter data, i only get the first row in the grid, by navigation
>>>> i can continou browsing when datalink grid = vraagbak_Firma.rowset
>>>>
>>>> when i change the datalink to vraagbak_bezoek i get all the dats of
>>>> the persons in the range , like  date >= 01/01/2015  and date <=
>>>> "15/01/2021
>>>>
>>>> using the query bezoek as parent en firma as child
>>>>
>>>> what i am missing here
>>>> thanks to put me on right way
>>>>
>>>> Dirk
>>>>
>>>> function knop_aanvang_onClick
>>>>     local dStart, dEinde, volgnr
>>>>      dStart= (form.keuzeveld_begin.value)
>>>>       dEinde=(form.keuzeveld_einde.value)
>>>>
>>>>       this.parent.vraagbak_bezoek.params["Start"] = dstart
>>>>        this.parent.vraagbak_bezoek.params["Einde"] = dEinde
>>>>    this.parent.vraagbak_bezoek.requery()
>>>>         this.parent.rooster_info.datalink =
>>>> this.parent.vraagbak_firma.rowset
>>>>
>>>>
>>>>    this.VRAAGBAK_BEZOEK = new QUERY(this)
>>>>     with (this.VRAAGBAK_BEZOEK)
>>>>        left = 210.0
>>>>        top = 187.0
>>>>        width = 92.0
>>>>        height = 37.0
>>>>        database = form.databank_klanten
>>>>        sql = "Select idnummer, visit, time1, time2  from visit where
>>>> visit >= :Start and visit <= :Einde order by visit"
>>>>        Requestlive = false
>>>>        params["Start"] = {}
>>>>        params["Einde"] = {}
>>>>        active = true
>>>>     endwith
>>>>
>>>>     with (this.VRAAGBAK_BEZOEK.rowset)
>>>>        onNavigate = class::ROWSET_ONNAVIGATE
>>>>        autoEdit = false
>>>>     endwith
>>>>
>>>>     this.VRAAGBAK_FIRMA = new QUERY(this)
>>>>     with (this.VRAAGBAK_FIRMA)
>>>>        left = 126.0
>>>>        top = 286.0
>>>>        width = 84.0
>>>>        height = 37.0
>>>>        database = form.databank_klanten
>>>>        sql = "select idnummer, name, plz, city, soort, outside from
>>>> stammdat where idnummer = :idnummer"
>>>>        requestLive = false
>>>>        params["idnummer"] = ""
>>>>        masterSource = form.vraagbak_bezoek.rowset
>>>>        active = true
>>>>     endwith
>>>>
>>>>     with (this.VRAAGBAK_FIRMA.rowset)
>>>>        with (fields["soort"])
>>>>           lookupSQL = "select segcode, description from segm"
>>>>        endwith
>>>>        with (fields["outside"])
>>>>           lookupSQL = "select  afkorting, name from employee order
>>>> by name"
>>>>        endwith
>>>>     endwith
>>>>
>>>
>>> try after setting your filter:
>>>
>>> form.rowset.refreshControls()
>>>
>>> You might want to also try checking to see how many rows are in your
>>> filter:
>>>
>>>     ? form.rowset.count()
>>>
>>> and in some cases, I have found that I might be actually at the last
>>> record, so:
>>>
>>> form.rowset.first()
>>>
>>> Ken
>>>
>> Ken,
>>
>> following your advice
>>
>> checked as follow: the same app but with Masterfields/rowset == 17 rows
>> grid schows all ok get the 17  rows
>>
>> with master source get the 17  rows aswell
>>
>> before refreshing and after refreshing
>>
>> added 2 grid columms
>>
>> vraagbak_bezoek :: idnummer ; i get 17 different idnumbers
>>
>> vraagbak_firma :: idnummer  : i get 17 times the first idnummer
>>
>> checked with past dates == 01/01/2015  and 05/01/2015
>>
>> even with rowset.first, but using requery it goes directly to the
>> first rows
>>
>>
>> annex pictures of Grid
>
> I can't tell you why you're getting incorrect here.
>
> Are your tables DBF tables or from a SQL server? If DBF you should be
> using masterFields/masterRowset. If you are using tables from a SQL
> server, you should be using masterSource. At least that's how I
> understand it.
>
> Ken
>
>