Subject Re: Filter on 2 fields with lookup
From Dirk C <dirk@C.com>
Date Wed, 27 Mar 2024 18:31:16 +0100
Newsgroups dbase.getting-started
Attachment(s) Schermafbeelding 2024-03-27 181642.png

Op 27/03/2024 om 17:08 schreef Mervyn Bick:
> On 2024/03/27 13:07, Dirk C wrote:
>
>>
>>   is working as long the value of the combobox is in stammdat.dbf
>>
>>   when the value isn't, cannot filter any more, even i Null the filter
>>
>>   even i want to get the names from stammdat from the selected country
>>
>>   with the value (selecteren) so i can pointed the correct segment value
>>
>>   for now main cornern is to filter
>>
>>    or is it better to use sql statement ?
>>
>> can you have a look to the attached file
>>
>> thanks
>
> Dirk, I'm afraid the form is simply too complex to work out what does
> what without being able to run it.  A screenshot of the form with a
> description of what you want to change in the display may help me
> understand what you're after.
>
> Many years ago I moved all my own data to Firebird so I only use SQL for
> my own code.  Even before that I used SQL in preference to the dBASE DML
> commands.  Instead of setting filters I use parameter driven queries to
> create rowsets of the records I want.
>
> Mervyn.
>
Mervin,

once selected a country, combow : sorteer and segemt are enabled = true
and the grids appear for bedrijfstak,merken en producten and topics as

date grid also

segment combox filter o, kind of segment, for now is filtering by

segment, i managed to filter by segment and country :

the issui is when a segment in the segment combox doesn't appear in the

Data in vraagbak.stammdat, filter stops to work

i tried already to set Filter is NuLL or " "

to bring rowset first()
  when rowset first i controll all the data over all the countries

i understand, if you, as i also read, more are involved with server based.

thanks

Dirk


  Function KEUZEDOOS_SOORTEN_onChange()
    form.rowset.filter = NULL
    local cSegm, cS, cMomentFilter
    this.style = 2
     cSegm = form.vraagbak_stammdat.rowset.fields['soort'].lookuprowset
   //soort
      cSegm.applyLocate([description = '] +this.value+['])   // description
       cS = (cSegm.fields[1].value)
      cLand =
form.vraagbak_stammdat.rowset.fields['country'].lookuprowset // land
       cLandcode = (cland.fields[1].value)
        form.rowset.Filter :=[soort =']+cS+['  and country = ']
+clandcode+[']
          ? form.rowset.filter // result // soort ='0014'  and country =
'0001'ok
           ? form.rowset.Filter = NULL + "1" // result is false Ok
    //         //form.rowset.filter = " "
     form.rowset.first()
      //form.rowset.filter = NULL
   Return
   ****