Find record w/ conditions met in the same child record

Ask a Question related to FileMaker, Design and Development.

  1. #1

    Default Find record w/ conditions met in the same child record

    I'll use 2 files to demonstrate my question.

    The first file is Animal. It has 4 fields.
    Id (serial number)
    ZooId (number)
    Name (text)
    Food (text)

    The second file is Zoo. It has 1 field.
    ZooId (serial number)

    Zoo also has a relationship, Animal. I bet you can guess what it is!
    ZooId = Animal::ZooId

    There is one record in Zoo. It has two related records in Animal. The
    values for Name and Food are
    dog bone
    cat tuna

    Zoo has a layout with a portal based on Animal in it. Animal::Name and
    Animal::Food are displayed in the portal. If I go into find mode and enter
    "dog" and "bone" in the first row of the portal (the only row available in
    find mode), I hit the record. That's good. If I enter "dog" and "tuna", I
    still hit the record. That's a reasonable way for things to work, but it's
    not what I need right now. I only want records where the same child record
    matches all the criteria.

    I have 2 ideas, neither of which I like.

    One is to add a calc field to Animal. NameFood = Animal & "_" & Food, and
    do my find on that. The find will be scripted, so I'm not worried about
    this being weird for the user. But in the real database that I'm working
    with, it's a lot more than two fields involved, and a concatenation would go
    over FM's 60 meaningful character limit.

    The other is to do the find in the child file, then loop through the found
    set, creating a find request (using ZooId) in the parent for each record.
    I'm not confident about FM's performance of a find with, say, 300 find
    requests.

    Does anyone have another approach? Or is my second idea not as unpleasant
    as I think it is?

    Thanks

    Thomas Berg

    Thomas Berg Guest

  2. Similar Questions and Discussions

    1. find row number of specific record in another query
      How can I find the row number for a specific record from one query in the record set of another query? qryGetCompany returns 6 records at a time. I...
    2. problem in master child record
      hi All i am using master child records in a DataGrid. i user template coloum for detail record in a data grid. but the problem is when the child...
    3. ADOXtra: find record
      Does anyone know a good way to find a particular record in a recordset? I was hoping there would be something like rst.Seek(), but there isn't. ...
    4. Stop adding record in subform after record count = 1
      Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the...
    5. Find Record
      I have an unbound dialog form with three textboxes on it for the user to enter either a delivery date, a booking number or a breedercode(text). The...
  3. #2

    Default Re: Find record w/ conditions met in the same child record

    You should take a look at the TechInfo article at
    [url]http://www.filemaker.com/ti/105843.html[/url]

    Thomas Berg wrote:
    > I'll use 2 files to demonstrate my question.
    >
    > The first file is Animal. It has 4 fields.
    > Id (serial number)
    > ZooId (number)
    > Name (text)
    > Food (text)
    >
    > The second file is Zoo. It has 1 field.
    > ZooId (serial number)
    >
    > Zoo also has a relationship, Animal. I bet you can guess what it is!
    > ZooId = Animal::ZooId
    >
    > There is one record in Zoo. It has two related records in Animal. The
    > values for Name and Food are
    > dog bone
    > cat tuna
    >
    > Zoo has a layout with a portal based on Animal in it. Animal::Name and
    > Animal::Food are displayed in the portal. If I go into find mode and enter
    > "dog" and "bone" in the first row of the portal (the only row available in
    > find mode), I hit the record. That's good. If I enter "dog" and "tuna", I
    > still hit the record. That's a reasonable way for things to work, but it's
    > not what I need right now. I only want records where the same child record
    > matches all the criteria.
    >
    > I have 2 ideas, neither of which I like.
    >
    > One is to add a calc field to Animal. NameFood = Animal & "_" & Food, and
    > do my find on that. The find will be scripted, so I'm not worried about
    > this being weird for the user. But in the real database that I'm working
    > with, it's a lot more than two fields involved, and a concatenation would go
    > over FM's 60 meaningful character limit.
    >
    > The other is to do the find in the child file, then loop through the found
    > set, creating a find request (using ZooId) in the parent for each record.
    > I'm not confident about FM's performance of a find with, say, 300 find
    > requests.
    >
    > Does anyone have another approach? Or is my second idea not as unpleasant
    > as I think it is?
    >
    > Thanks
    >
    > Thomas Berg
    >
    --
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Howard Schlossberg (818) 883-2846
    FM Pro Solutions Los Angeles, California
    Associate Member, FileMaker Solutions Alliance

    Howard Schlossberg Guest

  4. #3

    Default Re: Find record w/ conditions met in the same child record


    "Thomas Berg" <tbSPAMISBADerg@insight-system.co.jp> wrote in message
    news:bn2b11$fm6$1@nn-tk103.ocn.ad.jp...
    > I'll use 2 files to demonstrate my question.
    >
    > The first file is Animal. It has 4 fields.
    > Id (serial number)
    > ZooId (number)
    > Name (text)
    > Food (text)
    >
    > The second file is Zoo. It has 1 field.
    > ZooId (serial number)
    >
    > Zoo also has a relationship, Animal. I bet you can guess what it is!
    > ZooId = Animal::ZooId
    >
    > There is one record in Zoo. It has two related records in Animal. The
    > values for Name and Food are
    > dog bone
    > cat tuna
    >
    > Zoo has a layout with a portal based on Animal in it. Animal::Name and
    > Animal::Food are displayed in the portal. If I go into find mode and
    enter
    > "dog" and "bone" in the first row of the portal (the only row available in
    > find mode), I hit the record. That's good. If I enter "dog" and "tuna",
    I
    > still hit the record. That's a reasonable way for things to work, but
    it's
    > not what I need right now. I only want records where the same child
    record
    > matches all the criteria.
    >
    > I have 2 ideas, neither of which I like.
    >
    > One is to add a calc field to Animal. NameFood = Animal & "_" & Food, and
    > do my find on that. The find will be scripted, so I'm not worried about
    > this being weird for the user. But in the real database that I'm working
    > with, it's a lot more than two fields involved, and a concatenation would
    go
    > over FM's 60 meaningful character limit.
    >
    > The other is to do the find in the child file, then loop through the found
    > set, creating a find request (using ZooId) in the parent for each record.
    > I'm not confident about FM's performance of a find with, say, 300 find
    > requests.
    >
    > Does anyone have another approach? Or is my second idea not as unpleasant
    > as I think it is?
    >
    > Thanks
    >
    > Thomas Berg
    >
    I've never tried a find with 300 requests, but if it is indeed too slow,
    perhaps you could use a multi-line key key instead. When looping through the
    found set, set a global text field to itself & "(line break)" & the current
    record's ZooID. This way, you won't need a second find in the zoo file, just
    go to the related records from the global multi_line key field (of course,
    you have to set a relationship for this).

    Just my 2 cents :)

    Marc-Andre Paiement


    Marc-Andre Paiement Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139