Subject Re: Data module with a complex index
From wjs <>
Date Sun, 8 Dec 2019 07:15:55 +0200
Newsgroups dbase.getting-started

On 2019-12-06 11:39 AM, Robbie Nott wrote:
Hi Robbie
Did you consider masterRowset and masterField using your index ?
Attached a simple dataModule I use to show a selected horse's endurance
Hope it helps.


Created 2017/06/08
Data module to use as finder for horse EDR performance
2017/10/24 Link enduro to HorseNames with the H_ID and use the new
complex index HIDDOR
            created on H_ID + DOR in order to have the results ordered
by date.
            Further, note the setup of the Enduro.dbf (as Results1
query) AND THE navigateByMaster = true !!!
            This last setting allows me to use the HORSECODE field of
the Enduro.dbf in the same grid as the HorseNames.dbf fields !!
NOTE NOTE: The form MUST MUST have this EDR_NAMES1 rowset as the form's
rowset else the setup of the
            Names grid using the Enduro HORSECODE field will NOT WORK !

    with (this)
       left = -1.0
       top = -1.0

    this.EDR_NAMES1 = new WS_QUERY()
    this.EDR_NAMES1.parent = this
    with (this.EDR_NAMES1)
       left = 5.0
       top = -20.0
       sql = 'select * from "HorseNames.dbf" where IS_EDR = true'
       requestLive = false  //make this a non-editable rowset !
       active = true

    with (this.EDR_NAMES1.rowset)
       indexName = "HNME"

    this.RESULTS1 = new WS_QUERY()
    this.RESULTS1.parent = this
    with (this.RESULTS1)
       left = 66.0
       top = -21.0
       sql = 'select * from "Enduro.DBF"'
       active = true

    with (this.RESULTS1.rowset)
       indexName = "HIDDOR"
       masterRowset = form.edr_names1.rowset
       masterFields = "H_ID"
       navigateByMaster = true // See comment at top !!!!

   this.rowset = this.edr_names1.rowset
   //NOTE NOTE: The form MUST MUST have this rowset as the form rowset else
   //           the setup of the Names grid will NOT WORK !